-
Notifications
You must be signed in to change notification settings - Fork 2k
30 lines (27 loc) · 984 Bytes
/
doctoc.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
name: Check generated TOCs
on:
pull_request:
paths:
- "README.md"
- "docs/BestPractices.md"
permissions:
contents: read
jobs:
doctoc:
name: Doc TOC Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 'lts/*'
- name: Install doctoc
run: npm i -g doctoc
- name: Create README copy and diff with doctoc
run: cp README.md README.md.tmp &&
doctoc --title='## Table of Contents' --github README.md &&
diff -q README.md README.md.tmp
- name: Create "docs/BestPractices.md" copy and diff with doctoc
run: cp docs/BestPractices.md docs/BestPractices.md.tmp &&
doctoc --title='## Table of Contents' --github docs/BestPractices.md &&
diff -q docs/BestPractices.md docs/BestPractices.md.tmp