Repository navigation
Add a link checker workflow using lychee - #9209
Conversation
9cb01e6 to
c37cc70
Compare
c37cc70 to
db9377e
Compare
4c76f80 to
f9fa766
Compare
| --exclude-path '(^|/)\.lycheeignore$' | ||
| ${{ github.event_name == 'pull_request' && '--files-from changed-files.txt' || '.' }} |
There was a problem hiding this comment.
It looks like --files-from ignores the extensions setting:
$ printf ".lycheeignore" > files.txt
$ lychee --files-from files.txt --extensions txt
[EXCLUDED] http://wiremock:8080/ (at 4:1) | This is due to your 'exclude' values
[EXCLUDED] http://freshrss/ (at 5:1) | This is due to your 'exclude' values
[EXCLUDED] http://freshrss/ (at 31:1) | This is due to your 'exclude' values
[ERROR] https://publish/ (at 16:1) | Connection failed. Check network connectivity and firewall settings
[ERROR] http://a/ (at 10:1) | Connection failed. Check network connectivity and firewall settings
[ERROR] https://web/ (at 11:1) | Connection refused - server may be down or port blocked
...
lycheeignore is not included in extensions.
|
I have not checked: is it set up to distinguish between status codes:
|
On a full scan it shows the redirect status codes: https://github.com/Inverle/FreshRSS/actions/runs/31907721553 |
All right. It would be nice to filter out some of the noise by excluding 302, 307. |
|
I don't see an option for that in https://lychee.cli.rs/guides/config/ or https://lychee.cli.rs/guides/cli/ Closest thing is |
| - name: Get changed files | ||
| if: github.event_name == 'pull_request' | ||
| run: | | ||
| git diff --name-only --diff-filter=ACMR \ | ||
| "${{ github.event.pull_request.base.sha }}" \ | ||
| "${{ github.event.pull_request.head.sha }}" \ | ||
| > changed-files.txt |
There was a problem hiding this comment.
If there is a file renamed, which is referenced in some Markdown document, and the link is not updated, then currently this will only be caught after push.
There was a problem hiding this comment.
Might require failIfEmpty: false otherwise PRs without any link at all risk failing, aren't they?
https://github.com/lycheeverse/lychee-action/blob/e7477775783ea5526144ba13e8db5eec57747ce8/entrypoint.sh#L61-L63
There was a problem hiding this comment.
Possibly, was not aware of that option.
There was a problem hiding this comment.
If there is a file renamed, which is referenced in some Markdown document, and the link is not updated, then currently this will only be caught after push.
Fixed in bd954fe, will be caught by a offline run.
|
Yes that's better |
|
Oh, that is quite a bad start: https://github.com/FreshRSS/FreshRSS/actions/runs/40075763611 |
|
Ouch, yes. That's not great. |
|
Let's see how it behaves at next commit |
|
There are only a few errors and timeouts, some of which can be fixed. Either by correcting a link or adding it to 5 of the links in particular are broken. There are fewer redirects in the new run, since they were cached in the previous run. |
* Fix some broken links from CI scans Follow-up of #9209 and #9207. See: #9209 (comment) * Apply some selected redirects * Escape . properly
|
Because of Gentoo wiki:
(and a random CREDITS.md timeout) |
* Never fail lychee workflow on push events to reduce noise Suggestion for #9209 (comment) * Gentoo wiki temp ignore
This run would have succeeded for example, if it weren't for `accept_timeouts = false` being set in the config: https://github.com/FreshRSS/FreshRSS/actions/runs/40368577800#summary-121732842378 At the beginning of the original PR (#9209) I already had `accept_timeouts` set to `true`, but changed my mind later. (it doesn't seem worth it though)
|
Would it be possible to check only the modified lines? There are still some very long runs (24+ minutes) |
|
I have some idea, but it will require some work #9507 (comment) edit: that would still scan the entire repo though, so instead of that - files would have to be edited in place to remove all the irrelevant links but still preserve the actual line numbers for relevant links before the "Run lychee" step |
|
Might be temporary, but this check regularly fails for various reasons:
|
|
This still gives quite a lot of noise, e.g. https://github.com/FreshRSS/FreshRSS/actions/runs/44540479037/job/135617138384?pr=9590
It would be interesting to reduce the check to the actual lines modified by a PR instead of the whole files |
|
Yes, I'm planning to work on it. #9209 (comment) |
|
Ok. I have disabled it for now so that it does not make too much noise (also when not failing it produces enormous logs at the moment with all the ignored URLs) |
Ref: #9209 (comment) Only checks modified or added URLs in PRs to reduce noise. The workflow still continues to scan the entire repo for push and cron events. Tested working in a fork PR.



Depends on #9207 (merged)
https://github.com/lycheeverse/lychee-action