File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments