-
-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (37 loc) · 1.02 KB
/
Copy pathupdate-readme.yml
File metadata and controls
44 lines (37 loc) · 1.02 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
43
44
name: Auto‑update README TOC
permissions:
contents: write
on:
push:
paths:
- '*/**'
- '.github/workflows/update-readme.yml'
- 'scripts/order.py'
jobs:
regen-readme:
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
with:
persist-credentials: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: ⚙️ Generate TOC
run: python3 scripts/order.py
- name: Commit & Push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "actions@github.com"
git add README.md
if ! git diff --staged --quiet; then
git commit -m "chore: auto‑update README TOC"
git push
else
echo "README.md already up to date."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}