Menu

How to check links with lychee in GitHub Actions (config, caching, and the false positives to exclude)
📰

How to check links with lychee in GitHub Actions (config, caching, and the false positives to exclude)

DEV Community: github·linkbruno.com·about 14 hours ago
#lHc0wa2U
#devtogithub#technology#devto#dev#install
Reading 0:00
15s threshold

Scheduled broken-link and redirect checks that tell you the moment a link breaks — linkbruno.com

lychee is a link checker written in Rust. It's fast, it understands Markdown, HTML and plain text, and it has an official GitHub Action. That makes it one of the easiest ways to stop broken links landing in a docs repo or a static site.

The default setup works, but it tends to produce a noisy first run: rate-limited sites, links that need a login, and example URLs that were never meant to resolve. This post gets you from zero to a quiet, useful check: one workflow for pull requests, one for a weekly sweep, a config file, caching, and the exclusions worth adding on day one.

The minimal workflow

Create .github/workflows/links.yml :

name : Links

on : pull_request : schedule : - cron : "0 6 * * 1" # Mondays 06:00 UTC workflow_dispatch :

jobs : lychee : runs-on : ubuntu-latest steps : - uses : actions/checkout@v4

- name : Check links uses : lycheeverse/lychee-action@v2 with : args : --config lychee.toml…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.