Create update-toc.yml

This commit is contained in:
Jacob Kraniak 2026-03-07 21:05:24 -05:00 committed by GitHub
parent ef1e059576
commit 72b9821a8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 33 additions and 0 deletions

33
.github/workflows/update-toc.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Update TOC
on:
push:
branches: [ JK_Revisions ]
paths:
- '**.md' # Trigger on any markdown change
jobs:
update-toc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for commit history
- name: Install doctoc
run: npm install -g doctoc
- name: Run doctoc on README and INDEX files
run: |
doctoc README.md
doctoc tools/_INDEX.md # or tools/INDEX.md after rename
doctoc documentation/INDEX.md
# Add more files as needed, e.g.:
# doctoc tools/security/INDEX.md
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: auto-update TOC [skip ci]"
branch: JK_Revisions
skip_dirty_check: false