1
1
name : Verify links
2
2
3
3
on :
4
- push :
5
- branches :
6
- - main
7
- - workflow/verify-links # TODO REMOVE
4
+ # push:
5
+ # branches:
6
+ # - main
7
+ # - workflow/verify-links # TODO Remove before merging PR
8
8
repository_dispatch :
9
9
workflow_dispatch :
10
+ workflow_call :
11
+ inputs :
12
+ create_issue :
13
+ required : false
14
+ type : boolean
15
+ default : false
10
16
schedule :
11
17
- cron : " 08 08 * * 1"
12
18
13
19
jobs :
14
- linkChecker :
20
+ link_checker :
15
21
runs-on : ubuntu-latest
16
22
permissions :
17
23
issues : write # required for peter-evans/create-issue-from-file
18
24
steps :
19
- - uses : actions/checkout@v4
25
+ - uses : actions/download-artifact@v5
26
+ with :
27
+ name : " github-pages"
28
+ path : " prod"
29
+
30
+ - name : Checkout lychee toml file
31
+ uses : actions/checkout@v5
32
+ with :
33
+ path : repo
34
+ sparse-checkout : ' .lychee.toml'
35
+ sparse-checkout-cone-mode : false
20
36
21
37
- name : Restore lychee cache
22
38
uses : actions/cache@v4
@@ -25,45 +41,40 @@ jobs:
25
41
key : cache-lychee-${{ github.sha }}
26
42
restore-keys : cache-lychee-
27
43
44
+ - run : |
45
+ ls -la
46
+ ls -la repo/
47
+
28
48
- name : Link Checker
29
49
id : lychee
30
50
uses : lycheeverse/lychee-action@v2
31
51
with :
32
- fail : false
33
- # Exclude all private and local addresses in the check
34
- # Also exclude domains that actively block GitHub to send requests
35
- # Any Cockpit URLs it finds that have variables will be ignored too
36
52
args : |
37
- --max-concurrency 1
38
- --retry-wait-time 60
39
- --base .
40
- --skip-missing
41
- --exclude-all-private
42
- --exclude '^https://linux.die.net'
43
- --exclude 'file:///'
44
- --exclude 'domain.tld'
45
- --exclude '^.*\{\{'
46
- --exclude 'https://bodhi.fedoraproject.org/updates/cockpit-*'
47
- --cache
48
- --cache-exclude-status 400..=599
49
- --max-cache-age 1d
50
- -v
53
+ --root-dir "${{github.workspace}}/prod"
54
+ --config "${{github.workspace}}/repo/.lychee.toml"
51
55
.
52
56
token : ${{ secrets.GITHUB_TOKEN }}
57
+ continue-on-error : true
53
58
54
59
- name : Find the last open report issue
55
- if : steps.lychee.outputs.exit_code != 0
60
+ if : |
61
+ steps.lychee.outputs.exit_code != 0
62
+ && inputs.create_issue
56
63
id : last-issue
57
64
uses : micalevisk/last-issue-action@v2
58
65
with :
59
66
state : open
60
67
labels : link-checker
61
68
62
69
- name : Update or create issue report
63
- if : steps.lychee.outputs.exit_code != 0 && steps.last-issue.outputs.has-found == 'true'
70
+ if : |
71
+ steps.lychee.outputs.exit_code != 0
72
+ && steps.last-issue.outputs.has-found == 'false'
73
+ && inputs.create_issue
64
74
uses : peter-evans/create-issue-from-file@v5
65
75
with :
66
- title : Link Checker Report
76
+ title : Broken links detected in docs 🔗
67
77
content-filepath : ./lychee/out.md
68
78
issue-number : ${{ steps.last-issue.outputs.issue-number }}
79
+ token : ${{secrets.GITHUB_TOKEN}}
69
80
labels : link-checker
0 commit comments