-
Notifications
You must be signed in to change notification settings - Fork 4
41 lines (33 loc) · 987 Bytes
/
check-toc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Check ToC
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-toc.yml"
- "README.md"
pull_request:
paths:
- ".github/workflows/check-toc.yml"
- "README.md"
workflow_dispatch:
repository_dispatch:
jobs:
check:
name: ${{ matrix.file.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file:
- name: README.md
# Max ToC depth, for use with the markdown-toc --maxdepth flag.
maxdepth: 3
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install markdown-toc
run: sudo npm install --global markdown-toc
- name: Rebuild ToC
run: markdown-toc --bullets=- --maxdepth=${{ matrix.file.maxdepth }} -i "${{ github.workspace }}/${{ matrix.file.name }}"
- name: Check ToC
run: git diff --color --exit-code