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
1319jobs :
14- linkChecker :
20+ link_checker :
1521 runs-on : ubuntu-latest
1622 permissions :
1723 issues : write # required for peter-evans/create-issue-from-file
1824 steps :
19- - uses : actions/checkout@v4
25+ - uses : actions/download-artifact@v5
26+ with :
27+ name : " github-pages"
28+
29+ - name : Checkout lychee toml file
30+ uses : actions/checkout@v5
31+ with :
32+ path : repo
33+ sparse-checkout : ' .lychee.toml'
34+ sparse-checkout-cone-mode : false
2035
2136 - name : Restore lychee cache
2237 uses : actions/cache@v4
@@ -25,45 +40,40 @@ jobs:
2540 key : cache-lychee-${{ github.sha }}
2641 restore-keys : cache-lychee-
2742
43+ - run : |
44+ ls -la
45+ ls -la repo/
46+
2847 - name : Link Checker
2948 id : lychee
3049 uses : lycheeverse/lychee-action@v2
3150 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
3651 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
52+ --root-dir "${{github.workspace}}/prod"
53+ --config "${{github.workspace}}/repo/.lychee.toml"
5154 .
5255 token : ${{ secrets.GITHUB_TOKEN }}
56+ continue-on-error : true
5357
5458 - name : Find the last open report issue
55- if : steps.lychee.outputs.exit_code != 0
59+ if : |
60+ steps.lychee.outputs.exit_code != 0
61+ && inputs.create_issue
5662 id : last-issue
5763 uses : micalevisk/last-issue-action@v2
5864 with :
5965 state : open
6066 labels : link-checker
6167
6268 - name : Update or create issue report
63- if : steps.lychee.outputs.exit_code != 0 && steps.last-issue.outputs.has-found == 'true'
69+ if : |
70+ steps.lychee.outputs.exit_code != 0
71+ && steps.last-issue.outputs.has-found == 'false'
72+ && inputs.create_issue
6473 uses : peter-evans/create-issue-from-file@v5
6574 with :
66- title : Link Checker Report
75+ title : Broken links detected in docs 🔗
6776 content-filepath : ./lychee/out.md
6877 issue-number : ${{ steps.last-issue.outputs.issue-number }}
78+ token : ${{secrets.GITHUB_TOKEN}}
6979 labels : link-checker
0 commit comments