11name : Verify links
22
33on :
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
88 repository_dispatch :
99 workflow_dispatch :
10+ workflow_call :
11+ inputs :
12+ create_issue :
13+ required : false
14+ type : boolean
15+ default : false
1016 schedule :
1117 - cron : " 08 08 * * 1"
1218
19+ concurrency :
20+ group : ${{ github.workflow }}-${{ github.ref }}
21+ cancel-in-progress : true
22+
1323jobs :
14- linkChecker :
24+ link_checker :
1525 runs-on : ubuntu-latest
1626 permissions :
1727 issues : write # required for peter-evans/create-issue-from-file
1828 steps :
19- - uses : actions/checkout@v4
29+ - uses : actions/download-artifact@v5
30+ with :
31+ name : " build"
32+ path : " prod"
33+
34+ - name : Checkout lychee toml file
35+ uses : actions/checkout@v5
36+ with :
37+ path : repo
38+ sparse-checkout : ' .lychee.toml'
39+ sparse-checkout-cone-mode : false
2040
2141 - name : Restore lychee cache
2242 uses : actions/cache@v4
@@ -30,40 +50,31 @@ jobs:
3050 uses : lycheeverse/lychee-action@v2
3151 with :
3252 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
3653 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
54+ --root-dir "${{github.workspace}}/prod"
55+ --config "${{github.workspace}}/repo/.lychee.toml"
5156 .
5257 token : ${{ secrets.GITHUB_TOKEN }}
5358
5459 - 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
5663 id : last-issue
5764 uses : micalevisk/last-issue-action@v2
5865 with :
5966 state : open
6067 labels : link-checker
6168
6269 - 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
6474 uses : peter-evans/create-issue-from-file@v5
6575 with :
66- title : Link Checker Report
76+ title : Broken links detected in docs 🔗
6777 content-filepath : ./lychee/out.md
6878 issue-number : ${{ steps.last-issue.outputs.issue-number }}
79+ token : ${{secrets.GITHUB_TOKEN}}
6980 labels : link-checker
0 commit comments