Skip to content

Commit

Permalink
Add toc workflow
Browse files Browse the repository at this point in the history
  • 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.
33 changes: 33 additions & 0 deletions .github/workflows/generate-toc.yml
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

0 comments on commit bdc7282

Please sign in to comment.