Skip to content

Instantly share code, notes, and snippets.

@paul
Created September 18, 2020 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paul/8dd0fb3c5362dbae2c99f3802cb638b8 to your computer and use it in GitHub Desktop.
Save paul/8dd0fb3c5362dbae2c99f3802cb638b8 to your computer and use it in GitHub Desktop.
Update wiki pages with Table of Contents (using tocer gem) automatically when the wiki changes
# .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