Skip to content

Add toc workflow

Add toc workflow #1

Workflow file for this run

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