File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 44 pull_request :
55 types :
66 - closed
7+ push :
8+ branches :
9+ - main
710
811permissions :
912 contents : write
1013
11-
1214jobs :
1315 add-contributor :
14- if : github.event.pull_request.merged == true
16+ if : github.event_name == 'push' || github. event.pull_request.merged == true
1517 runs-on : ubuntu-latest
1618 steps :
1719 - name : Checkout repo
2325 node-version : 20
2426
2527 - name : Get PR author username
28+ if : github.event_name == 'pull_request'
2629 id : get_author
2730 run : echo "username=${{ github.event.pull_request.user.login }}" >> $GITHUB_OUTPUT
2831
32+ - name : Get committer username (for push)
33+ if : github.event_name == 'push'
34+ id : get_author
35+ run : echo "username=${{ github.actor }}" >> $GITHUB_OUTPUT
36+
2937 - name : Add contributor to README
3038 env :
3139 CONTRIBUTOR_USERNAME : ${{ steps.get_author.outputs.username }}
3644 uses : stefanzweifel/git-auto-commit-action@v5
3745 with :
3846 commit_message : " chore: add ${{ steps.get_author.outputs.username }} to Contributors in README"
39- branch : ${{ github.event.pull_request.base.ref }}
47+ branch : main
You can’t perform that action at this time.
0 commit comments