Update README.md #3
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
name: Generate Table of Contents | |
on: | |
push: | |
paths: | |
- 'README.md' | |
jobs: | |
generate-toc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup 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 | |
- name: Commit changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add README.md | |
git commit -m "Automatically update ToC" || echo "No changes to commit" | |
git push |