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 <ayushmore42595@gmail.com>
This commit is contained in:
@@ -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
|
||||
})
|
||||
Reference in New Issue
Block a user