Update wiki pages with Table of Contents (using tocer gem) automatically when the wiki changes
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
# .github/workflows/wiki_toc.yml | |
name: Update wiki table of contents | |
on: | |
- gollum | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
container: | |
image: ruby:2.6.6 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
repository: ${{github.repository}}.wiki | |
- name: Update Wiki TOC | |
run: | | |
gem install tocer -v '~>9.1' | |
tocer -g | |
- name: Commit changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Updated TOC" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
repository: ${{github.repository}}.wiki | |
github_token: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment