CI: GitCub: add On-Readme-update: add automatic TOC generation

This commit is contained in:
Anton-Latukha 2020-09-29 17:16:57 +03:00
parent 49c9f335f4
commit 0716f31574
No known key found for this signature in database
GPG Key ID: 3D84C07E91802E41
1 changed files with 33 additions and 0 deletions

33
.github/workflows/On-Readme-update.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: "On README change"
on:
push:
branches:
- master
paths:
- "README.md"
jobs:
build10:
name: "Check TOC, autogenerate and commit it into the PR"
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Install doctoc
run: |
sudo npm install -g doctoc
- uses: actions/checkout@v2
with:
# 2020-09-29: Official doc:
# "In non-push events, such as pull_request, make sure to specify the ref to checkout:'
ref: ${{ github.head_ref }}
- name: Generate the idenpotent TOC
run: |
doctoc --github --notitle README.md
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_author: "Anton Latukha <anton@latukha.com>"
commit_message: "[auto] upd README TOC"
file_pattern: "README.md"