Skip to content

Instantly share code, notes, and snippets.

@paul
Created Sep 18, 2020
Embed
What would you like to do?
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