-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GitHub] Add Greeting comment to new contributor's PRs with useful in…
…formation This adds a new workflow that responds to PRs that are opened by new contributors with a comment thanking the author for their contribution, and provides answers to common problems (problem for now, could expand later). According to my testing, and the docs here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target `opened` will only trigger on the first opening, not a re-open. I considered including this comment in the one the labeller adds, but that means that it would be emailed to all subscribers not just the author. This comment is only left for authors new to the LLVM repo or to GitHub itself. This is done by checking the value in: https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
- Loading branch information
1 parent
eb3c02f
commit e3773f3
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: PR Greeter | ||
|
||
on: | ||
pull_request_target: | ||
types: [ opened ] | ||
|
||
permissions: | ||
content: read | ||
|
||
jobs: | ||
greet: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
if: github.repository == 'llvm/llvm-project' && (github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' || github.event.pull_request.author_association == 'FIRST_TIMER') | ||
steps: | ||
- name: Setup Automation Script | ||
run: | | ||
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/github-automation.py | ||
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/requirements.txt | ||
chmod a+x github-automation.py | ||
pip install -r requirements.txt | ||
- name: Greet Author | ||
run: | | ||
./github-automation.py \ | ||
--token '${{ secrets.GITHUB_TOKEN }}' \ | ||
pr-greeter \ | ||
--issue-number "${{ github.event.pull_request.number }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters