It would be too disruptive for all the other tracks to add a link-checking workflow to the org-wide-files. But I think it would be helpful to add into the generic-track repo so that new tracks get it by default.
Perhaps it should be a monthly GitHub action instead of a workflow check.
stackoverflow.com and rosettacode.org added CAPTCHA or other blocking of lychee’s checks, and this meant PRs could not be merged until I added the domains to .lycheeignore
The website https://factorcode.org/ was down for a day or two, and this also blocked merges.
Even without Require status checks to pass before merging, workflow failures are distracting for reviewers.
I’d welcome a monthly link check in my repo. Maybe like the configlet-sync as a workflow to add or may be opt-in via .github/org-wide-files-config.toml?
OK, the exercism/github-actions PR has been merged. If you, as a maintainer, want monthly link checking in your repo (and not run as something that will block CI), you can add this workflow:
name: Check Links
on:
workflow_dispatch:
schedule:
- cron: 0 0 15 * * # 15th day of each month
jobs:
call-gha-workflow:
uses: exercism/github-actions/.github/workflows/link-checker.yml@main
It also can be manually dispatched to do link checking on demand.
I forgot to mention: If you use this workflow, you should add a .lycheeignore file to the repo containing patterns for domains known to not accept bot requests. At minimum
Tried to add the link checker to PHP track. Using it locally provided these challenges:
lychee dives into installed libraries like vendor/ and there is no “exclude files by path” in the examples given here. I had to add lychee.toml and fill it with the ignore patterns (and add it to the docker args for local testing)
Exercism supports relative links into the website (/tracks/php/... and lychee cannot handle this without a configuration file, too. I added the base_url config entry, but it now ignores all links to local files (prefixed by base_url, which is exercism.org and ignored). I’m undecided whether to convert the relative links to ones including the domain or accepting file links to be ignored.
I have not yet tried if the config file is picked up by the action automatically. That might become another challenge.
Of course the first run did what is expected: Several links are dead and must be repaired / replaced. That’s a challenge to expect, but maintainers like me might not be prepared for the real number of findings…
Thanks for providing the action and all the useful information around it! It will take some time to overcome the obstacles…