forked from Rohit-554/FirstLeaf
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.09 KB
/
Copy pathupdate-contributors.yml
File metadata and controls
42 lines (36 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Update Contributors in README
on:
push:
branches:
- main
- master
paths:
- 'data/contributors.ndjson'
jobs:
update-readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Update README with contributors
run: node scripts/update-readme-contributors.js
- name: Check for changes
id: git-check
run: |
git diff --exit-code README.md || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit and push if changed
if: steps.git-check.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add README.md
git commit -m "docs: update contributors section in README [skip ci]"
git push