From 136b597f844f54ef31147bf407e9e4a8d6936d7a Mon Sep 17 00:00:00 2001 From: Ayush More Date: Sun, 12 Oct 2025 12:35:05 +0530 Subject: [PATCH 1/3] 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 + }) From aeaf3445a411cbc54eb4f9a25ce0cf466d3ce276 Mon Sep 17 00:00:00 2001 From: Ayush More Date: Tue, 14 Oct 2025 20:47:22 +0530 Subject: [PATCH 2/3] Add permissions to welcome workflow Signed-off-by: Ayush More --- .github/workflows/welcome.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml index 2b511055c8..2a46b1b4b5 100644 --- a/.github/workflows/welcome.yml +++ b/.github/workflows/welcome.yml @@ -4,6 +4,11 @@ on: pull_request_target: types: [opened] +permissions: + issues: write + pull-requests: write + contents: read + jobs: welcome: runs-on: ubuntu-latest From 44b00497ceb67fe5a623397abc5071bc7e129122 Mon Sep 17 00:00:00 2001 From: benjdlambert Date: Tue, 4 Nov 2025 13:11:42 +0100 Subject: [PATCH 3/3] chore: fix prettier Signed-off-by: benjdlambert --- .github/workflows/welcome.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml index 2a46b1b4b5..5d47ba77da 100644 --- a/.github/workflows/welcome.yml +++ b/.github/workflows/welcome.yml @@ -5,9 +5,9 @@ on: types: [opened] permissions: - issues: write - pull-requests: write - contents: read + issues: write + pull-requests: write + contents: read jobs: welcome: