Skip to content

Commit 0716f31

Browse files
committed
CI: GitCub: add On-Readme-update: add automatic TOC generation
1 parent 49c9f33 commit 0716f31

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "On README change"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "README.md"
9+
10+
jobs:
11+
12+
build10:
13+
name: "Check TOC, autogenerate and commit it into the PR"
14+
runs-on: ubuntu-latest
15+
continue-on-error: true
16+
steps:
17+
- name: Install doctoc
18+
run: |
19+
sudo npm install -g doctoc
20+
- uses: actions/checkout@v2
21+
with:
22+
# 2020-09-29: Official doc:
23+
# "In non-push events, such as pull_request, make sure to specify the ref to checkout:'
24+
ref: ${{ github.head_ref }}
25+
- name: Generate the idenpotent TOC
26+
run: |
27+
doctoc --github --notitle README.md
28+
- name: Commit and push changes
29+
uses: stefanzweifel/git-auto-commit-action@v4
30+
with:
31+
commit_author: "Anton Latukha <[email protected]>"
32+
commit_message: "[auto] upd README TOC"
33+
file_pattern: "README.md"

0 commit comments

Comments
 (0)