-
Notifications
You must be signed in to change notification settings - Fork 1.2k
35 lines (30 loc) · 926 Bytes
/
build-toc.yaml
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
name: Generate TOC on PR Merge
on:
pull_request:
types: [closed]
branches:
- main
jobs:
run-script:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.base_ref == 'main'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Run TOC generation script
run: |
chmod +x .script/idxtool.sh
python3 .script/idxtool.sh --toc
- name: Commit TOC updates
run: |
git config --global user.name 'LouisShark'
git config --global user.email '[email protected]'
git add TOC.md
git commit -m "docs: Update TOC.md" || echo "No changes to commit"
git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}