Skip to content

Commit 19cb6aa

Browse files
authored
Merge pull request #10 from per1234/check-toc
Add CI workflow to check for missed updates to readme ToC
2 parents 59052b1 + b1b1b8b commit 19cb6aa

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/check-toc.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Check ToC
2+
3+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/check-toc.ya?ml"
8+
- "README.md"
9+
pull_request:
10+
paths:
11+
- ".github/workflows/check-toc.ya?ml"
12+
- "README.md"
13+
workflow_dispatch:
14+
repository_dispatch:
15+
16+
jobs:
17+
check:
18+
name: ${{ matrix.file.name }}
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
24+
matrix:
25+
file:
26+
- name: README.md
27+
# Max ToC depth, for use with the markdown-toc --maxdepth flag.
28+
maxdepth: 3
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v2
33+
34+
- name: Install markdown-toc
35+
run: sudo npm install --global markdown-toc
36+
37+
- name: Rebuild ToC
38+
run: |
39+
markdown-toc \
40+
--bullets=- \
41+
--maxdepth=${{ matrix.file.maxdepth }} \
42+
-i \
43+
"${{ github.workspace }}/${{ matrix.file.name }}"
44+
45+
- name: Check ToC
46+
run: git diff --color --exit-code

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ projects:
2020
- [`path`](#path)
2121
- [`version`](#version)
2222
- [`compliance`](#compliance)
23-
- [`format`](#format)
2423
- [`library-manager`](#library-manager)
2524
- [`project-type`](#project-type)
2625
- [`recursive`](#recursive)
2726
- [`report-file`](#report-file)
27+
- [`verbose`](#verbose)
2828
- [`token`](#token)
2929
- [Usage](#usage)
30+
- [Contributing](#contributing)
3031

3132
<!-- tocstop -->
3233

0 commit comments

Comments
 (0)