Skip to content

Commit 24fcebb

Browse files
committed
chore: Switch DocTOC build to GitHub Actions
Only executes when the TOC files have changed. Now also checks BestPractices.md
1 parent be6e86a commit 24fcebb

File tree

3 files changed

+27
-22
lines changed

3 files changed

+27
-22
lines changed

.github/workflows/doctoc.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check generated TOCs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "README.md"
7+
- "docs/BestPractices.md"
8+
9+
jobs:
10+
doctoc:
11+
name: Doc TOC Check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: '12.x'
18+
- name: Install doctoc
19+
run: npm i -g doctoc
20+
- name: Create README copy and diff with doctoc
21+
run: cp README.md README.md.tmp &&
22+
doctoc --title='## Table of Contents' --github README.md &&
23+
diff -q README.md README.md.tmp
24+
- name: Create "docs/BestPractices.md" copy and diff with doctoc
25+
run: cp docs/BestPractices.md docs/BestPractices.md.tmp &&
26+
doctoc --title='## Table of Contents' --github docs/BestPractices.md &&
27+
diff -q docs/BestPractices.md docs/BestPractices.md.tmp

.travis.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ jobs:
5757
script:
5858
- find . -name "*.md" | xargs -n 1 markdown-link-check
5959

60-
- stage: Test
61-
name: Doc Toc Check
62-
language: node_js
63-
node_js:
64-
- lts/*
65-
install: npm i -g doctoc
66-
script:
67-
- cp README.md README.md.tmp &&
68-
doctoc --title='## Table of Contents' --github README.md &&
69-
diff -q README.md README.md.tmp
70-
7160
- stage: Test
7261
name: shfmt check
7362
script:

travis.yml.template

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ jobs:
5555
script:
5656
- find . -name "*.md" | xargs -n 1 markdown-link-check
5757

58-
- stage: Test
59-
name: Doc Toc Check
60-
language: node_js
61-
node_js:
62-
- lts/*
63-
install: npm i -g doctoc
64-
script:
65-
- cp README.md README.md.tmp &&
66-
doctoc --title='## Table of Contents' --github README.md &&
67-
diff -q README.md README.md.tmp
68-
6958
- stage: Test
7059
name: shfmt check
7160
script:

0 commit comments

Comments
 (0)