-
Notifications
You must be signed in to change notification settings - Fork 426
43 lines (34 loc) · 1000 Bytes
/
Copy pathgenerate-readme.yml
File metadata and controls
43 lines (34 loc) · 1000 Bytes
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
43
name: Generate README
on:
push:
branches:
- main
paths:
- "data/projects.json"
workflow_dispatch: {}
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Regenerate README
run: node scripts/generate-readme.mjs
- name: Check for changes
id: diff
run: |
git diff --quiet README.MD && echo "changed=false" >> $GITHUB_OUTPUT || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit README
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.MD
git commit -m "chore: regenerate README from projects.json [skip ci]"
git push