Skip to content

Commit b42c394

Browse files
committed
[skip changelog] Fix link checking task and workflow
1 parent 0a32700 commit b42c394

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

.github/workflows/link-validation.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,41 @@ jobs:
2121
with:
2222
repo-token: ${{ secrets.GITHUB_TOKEN }}
2323

24+
- name: Install Go
25+
uses: actions/setup-go@v2
26+
with:
27+
go-version: "1.14"
28+
29+
- name: Installs Go dependencies
30+
shell: bash
31+
run: go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
32+
33+
- name: Install protoc compiler
34+
uses: arduino/setup-protoc@v1.1.0
35+
with:
36+
repo-token: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Setup Python
39+
uses: actions/setup-python@v1
40+
with:
41+
python-version: "3.6"
42+
architecture: "x64"
43+
44+
- name: Cache dependencies
45+
uses: actions/cache@v1
46+
with:
47+
path: ~/.cache/pip
48+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
49+
restore-keys: |
50+
${{ runner.os }}-pip-
51+
52+
- name: Install Python dependencies
53+
run: |
54+
python3 -m pip install --upgrade pip
55+
python3 -m pip install -r ./requirements_docs.txt
56+
57+
- name: Build docs
58+
run: task docs:build
59+
2460
- name: Verify links
2561
run: task docs:check-links

Taskfile.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ tasks:
5656

5757
docs:check-links:
5858
desc: Verifies there are no dead links in documentation
59-
dir: docs
6059
cmds:
61-
- npx -p markdown-link-check -c 'for file in **/*.md; do markdown-link-check -q "$file"; done'
60+
- |
61+
npx -p markdown-link-check -c '
62+
STATUS=0
63+
for file in $(find -name "*.md"); do
64+
markdown-link-check -c markdown-link-check-config.json -q "$file"
65+
STATUS=$(( $STATUS + $? ))
66+
done
67+
exit $STATUS'
6268
6369
docs:format:
6470
desc: Automatically formats documentation

markdown-link-check-config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "https?://localhost:\\d*/"
5+
},
6+
{
7+
"pattern": "https?://(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):\\d*"
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)