File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : First contribution
2+
3+ # Thanks someone the first time a PR of theirs is merged. On merge rather than on open:
4+ # at that point they've actually given something, so it reads as thanks instead of a pitch.
5+ #
6+ # pull_request_target is required to comment on a fork's PR — it runs with the base repo's
7+ # permissions. It therefore MUST NOT check out or execute the PR's code; this job only
8+ # posts a comment, and has no checkout step for that reason.
9+ on :
10+ pull_request_target :
11+ types : [closed]
12+
13+ permissions :
14+ pull-requests : write
15+
16+ jobs :
17+ thanks :
18+ if : >-
19+ github.event.pull_request.merged == true &&
20+ (github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' ||
21+ github.event.pull_request.author_association == 'FIRST_TIMER')
22+ runs-on : ubuntu-latest
23+ steps :
24+ - env :
25+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26+ PR : ${{ github.event.pull_request.number }}
27+ AUTHOR : ${{ github.event.pull_request.user.login }}
28+ run : |
29+ gh api --method POST "repos/${{ github.repository }}/issues/$PR/comments" -F body=@- <<EOF
30+ Merged — thanks @$AUTHOR, that's your first one here.
31+
32+ If the project turned out to be useful to you, a ⭐ genuinely helps: stacktale is
33+ new, and stars are most of what decides whether anyone else finds it.
34+
35+ Either way you're welcome back — the [\`good first issue\`](https://github.com/${{ github.repository }}/labels/good%20first%20issue)
36+ list is kept honest, and each one names the files to touch and how to verify.
37+ EOF
You can’t perform that action at this time.
0 commit comments