File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update Contributors
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch : # Allows manual triggering
8+
9+ jobs :
10+ update-contributors :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : write # Needed for pushing changes
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v3
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v3
20+ with :
21+ node-version : ' 18'
22+ cache : ' npm'
23+
24+ - name : Install dependencies
25+ run : npm ci
26+
27+ - name : Update contributors
28+ run : npm run update-contributors
29+ env :
30+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31+
32+ - name : Check for changes
33+ id : check-changes
34+ run : |
35+ if [[ -n "$(git status --porcelain README.md)" ]]; then
36+ echo "changes=true" >> $GITHUB_OUTPUT
37+ else
38+ echo "No changes to README.md"
39+ fi
40+
41+ - name : Commit and push changes
42+ if : steps.check-changes.outputs.changes == 'true'
43+ run : |
44+ git config --global user.name 'github-actions[bot]'
45+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
46+ git add README.md
47+ git commit -m "docs: update contributors list [skip ci]"
48+ git push
You can’t perform that action at this time.
0 commit comments