-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcheck-toc-task.yml
51 lines (43 loc) · 1.37 KB
/
check-toc-task.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
42
43
44
45
46
47
48
49
50
51
# Source: https://github.com/arduino/.github/blob/master/workflow-templates/check-toc-task.md
name: Check ToC
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-toc-task.ya?ml"
# TODO: Update this if ToC of any other files should be checked.
- "README.md"
pull_request:
paths:
- ".github/workflows/check-toc-task.ya?ml"
# TODO: Update this if ToC of any other files should be checked.
- "README.md"
workflow_dispatch:
repository_dispatch:
jobs:
check:
name: ${{ matrix.file.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file:
# TODO: Update this if any other files should be checked.
- name: README.md
# Max ToC depth, for use with the markdown-toc --maxdepth flag.
maxdepth: 3
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Rebuild ToC
run: |
task markdown:toc \
FILE_PATH="${{ github.workspace }}/${{ matrix.file.name }}" \
MAX_DEPTH=${{ matrix.file.maxdepth }}
- name: Check ToC
run: git diff --color --exit-code