-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 2.25 KB
/
linkchecker.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Check for broken links
on:
workflow_dispatch:
schedule:
# Run every weekend
- cron: '0 2 * * 6'
jobs:
# internal and external links and anchors
linkchecker:
runs-on: ubuntu-latest
steps:
- uses: liskin/gh-linkchecker@v0.1.0
with:
retries: 3
linkcheckerrc: |
[filtering]
checkextern=1
[AnchorCheck]
custom-jq-filter-post: |
def cv_redirects:
(.parentname | endswith("cv-resume.html")) and (
(.urlname | endswith("//lisk.in/")) or
(.urlname | endswith("//sqldep.com/"))
);
def cv_redirects_to_info: if cv_redirects then to_info end;
def git_line_anchors:
is_warning
and (.urlname | (contains("//github.com/") or contains("//gitlab.")))
and (.urlname | contains("#L"))
and (.warning | startswith("Anchor"));
def git_line_anchors_to_info: if git_line_anchors then to_info end;
def matrix_anchor:
is_warning
and (.urlname | contains("//matrix.to/#/@"))
and (.warning | startswith("Anchor"));
def matrix_anchor_to_info: if matrix_anchor then to_info end;
def moved_permanently_to_error:
if is_warning and (.warning | contains("status: 301 ")) then
to_error
end;
def moved_temporarily_to_info:
if is_warning and (.warning | contains("status: 302 ")) then
to_info
end;
def skip_rules:
.urlname == "https://wahoofitness.com/systm";
map(
if skip_rules then
.
else
moved_permanently_to_error |
moved_temporarily_to_info |
cv_redirects_to_info |
git_line_anchors_to_info |
matrix_anchor_to_info
end
)
workflow-keepalive:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: liskin/gh-workflow-keepalive@v1