-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Felix W
authored and
Felix W
committed
Nov 29, 2023
1 parent
95f94fc
commit bdc7282
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Generate Table of Contents | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Change this to your main branch name | ||
|
||
jobs: | ||
generate-toc: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install markdown-toc | ||
run: npm install -g markdown-toc | ||
|
||
- name: Generate TOC | ||
run: markdown-toc -i README.md # Replace README.md with the name of your Markdown file | ||
|
||
- name: Commit TOC changes | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git add README.md | ||
git commit -m "Generate and update Table of Contents" | ||
git push |