forked from canonical/ubuntu.com
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.51 KB
/
kubernetes-docs-links.yaml
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
52
53
54
55
56
57
58
59
60
61
name: docs links on ubuntu.com/kubernetes/docs
on:
schedule:
- cron: "0 13 * * *"
workflow_dispatch:
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install linkchecker
run: sudo pip install LinkChecker
- name: Write linkchecker config file
run: |
mkdir -p ~/.linkchecker
cat > ~/.linkchecker/linkcheckerrc <<EOF
[checking]
maxrequestspersecond=5
[filtering]
nofollow=!https:\/\/ubuntu.com\/kubernetes\/docs
checkextern=1
ignore=
https://res\.cloudinary\.com
http://snap-proxy\.example\.com
https://example\.com\/docker-registry
http://localhost*
/q_auto
c_fill
/fl_sanitize
e_sharpen
/w_
/h_
[output]
status=0
warnings=0
EOF
- name: Run linkchecker
continue-on-error: true
run: |
linkchecker https://ubuntu.com/kubernetes/docs > ~/.linkchecker/kubernetesdocs-out.txt
- name: Parse linkchecker output
run: |
scripts/parseDocsLinkcheckerOutput kubernetesdocs-out.txt
- name: Send message on failure
if: failure()
run: |
curl -X POST \
-F "workflow=${GITHUB_WORKFLOW}" \
-F "repo_name=${GITHUB_REPOSITORY}" \
-F "action_id=${GITHUB_RUN_ID}" \
${{ secrets.BOT_URL }}?room=docs