Skip to content

Add a link checker workflow using lychee - #9209

Merged
Alkarex merged 19 commits into
FreshRSS:edgefrom
Inverle:link-checker-workflow
Oct 24, 2026
Merged

Alkarex merged 19 commits into
FreshRSS:edgefrom
Inverle:link-checker-workflow

Conversation

@Inverle

@Inverle Inverle commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

@Inverle
Inverle force-pushed the link-checker-workflow branch 2 times, most recently from 9cb01e6 to c37cc70 Compare August 15, 2026 23:05
@Inverle Inverle added System care Everything related to system care github_actions Pull requests that update GitHub Actions code labels Aug 15, 2026
@Inverle Inverle added this to the 1.30.0 milestone Aug 15, 2026
@Inverle
Inverle force-pushed the link-checker-workflow branch from c37cc70 to db9377e Compare August 15, 2026 23:12
@Inverle
Inverle force-pushed the link-checker-workflow branch from 4c76f80 to f9fa766 Compare August 15, 2026 23:34
Comment thread .github/workflows/link-checker.yml Outdated
Comment on lines +56 to +57
--exclude-path '(^|/)\.lycheeignore$'
${{ github.event_name == 'pull_request' && '--files-from changed-files.txt' || '.' }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 13fdb0b

Comment thread .github/workflows/link-checker.yml Resolved
@Alkarex

Alkarex commented Aug 16, 2026

Copy link
Copy Markdown
Member

I have not checked: is it set up to distinguish between status codes:

  • 302 and 307: should be kept as-is (default)
  • 301 and 308: should be updated

@Alkarex

Alkarex commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

Security settings updated accordingly:

image

@Inverle

Inverle commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

I have not checked: is it set up to distinguish between status codes:

* 302 and 307: should be kept as-is (default)

* 301 and 308: should be updated

On a full scan it shows the redirect status codes: https://github.com/Inverle/FreshRSS/actions/runs/31907721553

@Alkarex

Alkarex commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

I have not checked: is it set up to distinguish between status codes:

* 302 and 307: should be kept as-is (default)

* 301 and 308: should be updated

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.

@Inverle

Inverle commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

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 accept, but that's the status code after the redirect.

Comment thread lychee.toml Resolved
Comment thread .lycheeignore Resolved
Comment thread .lycheeignore Resolved
Comment on lines +28 to +34
- 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Alkarex Alkarex Sep 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, was not aware of that option.

@Inverle Inverle Sep 20, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7307b3a

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/link-checker.yml Resolved
@Alkarex Alkarex modified the milestones: 1.30.0, 1.31.0 Sep 6, 2026
@Inverle Inverle removed this from the 1.31.0 milestone Sep 11, 2026
@Alkarex

Alkarex commented Oct 23, 2026

Copy link
Copy Markdown
Member

Still good @Inverle ? eaee383

@Inverle

Inverle commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Yes that's better

@Alkarex
Alkarex merged commit 456b9fb into FreshRSS:edge Oct 24, 2026
4 checks passed
@Inverle
Inverle deleted the link-checker-workflow branch October 24, 2026 10:21
@Alkarex

Alkarex commented Oct 24, 2026

Copy link
Copy Markdown
Member

Oh, that is quite a bad start: https://github.com/FreshRSS/FreshRSS/actions/runs/40075763611
We should probably revert, in favour of manual runs once in a while

@Frenzie

Frenzie commented Oct 24, 2026

Copy link
Copy Markdown
Member

Ouch, yes. That's not great.

@Alkarex

Alkarex commented Oct 24, 2026

Copy link
Copy Markdown
Member

Let's see how it behaves at next commit

@Alkarex

Alkarex commented Oct 24, 2026

Copy link
Copy Markdown
Member

@Inverle

Inverle commented Oct 24, 2026 •

Copy link
Copy Markdown
Member Author

There are only a few errors and timeouts, some of which can be fixed.

Either by correcting a link or adding it to .lycheeignore. Some timeouts may keep happening, probably because the website is blocking GitHub Actions IPs.

5 of the links in particular are broken.
1 is using antibot and responding 402 Payment Required.

There are fewer redirects in the new run, since they were cached in the previous run.

@Inverle

Inverle commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

#9495

Alkarex pushed a commit that referenced this pull request Oct 24, 2026
* Fix some broken links from CI scans

Follow-up of #9209 and #9207.

See: #9209 (comment)

* Apply some selected redirects

* Escape . properly
@Alkarex

Alkarex commented Oct 25, 2026

Copy link
Copy Markdown
Member

@Inverle

Inverle commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Because of Gentoo wiki:

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Cannot access the database)

(and a random CREDITS.md timeout)

@Inverle

Inverle commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Alkarex pushed a commit that referenced this pull request Oct 25, 2026
* Never fail lychee workflow on push events to reduce noise

Suggestion for #9209 (comment)

* Gentoo wiki temp ignore
Alkarex pushed a commit that referenced this pull request Oct 26, 2026
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)
@Alkarex

Alkarex commented Oct 30, 2026

Copy link
Copy Markdown
Member

Would it be possible to check only the modified lines?

There are still some very long runs (24+ minutes)
https://github.com/FreshRSS/FreshRSS/actions/runs/41130442458

@Inverle

Inverle commented Oct 30, 2026 •

Copy link
Copy Markdown
Member Author

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

@Alkarex

Alkarex commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

@Inverle

Inverle commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

@Inverle

Inverle commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

@Alkarex

Alkarex commented Nov 19, 2026

Copy link
Copy Markdown
Member

This still gives quite a lot of noise, e.g. https://github.com/FreshRSS/FreshRSS/actions/runs/44540479037/job/135617138384?pr=9590

image

It would be interesting to reduce the check to the actual lines modified by a PR instead of the whole files

@Inverle

Inverle commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Yes, I'm planning to work on it. #9209 (comment)

@Alkarex

Alkarex commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

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)

Alkarex pushed a commit that referenced this pull request Nov 23, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants