From 136b597f844f54ef31147bf407e9e4a8d6936d7a Mon Sep 17 00:00:00 2001 From: Ayush More Date: Sun, 12 Oct 2025 12:35:05 +0530 Subject: [PATCH] feat(workflows): Add welcome workflow for new contributors This automation helps new contributors feel welcomed and provides them with essential resources right away, streamlining their first contribution. The workflow is built using `pull_request_target` for secure execution on PRs from forks. Signed-off-by: Ayush More --- .github/workflows/welcome.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/welcome.yml diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml new file mode 100644 index 0000000000..2b511055c8 --- /dev/null +++ b/.github/workflows/welcome.yml @@ -0,0 +1,37 @@ +name: Add a welcome comment + +on: + pull_request_target: + types: [opened] + +jobs: + welcome: + runs-on: ubuntu-latest + if: github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' + steps: + - name: Add a welcome comment + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const pr = context.payload.pull_request + const login = pr.user.login + + const message = ` + Hi @${login}, thanks for opening your first pull request in Backstage! 👋 + + A couple of useful links to help you get started: + + * [Contributing Guide](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md) + * [DCO Sign-off Instructions](https://github.com/backstage/backstage/blob/master/DCO) + * [Style Guide](https://github.com/backstage/backstage/blob/master/STYLE.md) + + We really appreciate your contribution and look forward to reviewing your work. Welcome aboard! + ` + + await github.rest.issues.createComment({ + issue_number: pr.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: message + })