Urgent.News

What's breaking now, across thousands of outlets.

Tech

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

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…

Lychee is a link checker written in Rust, offering fast performance and support for Markdown, HTML, and plain text. It features an official GitHub Action, making it an easy solution to detect broken links in documentation repositories or static sites. The default setup may produce noisy results during the first run, including rate-limited sites, links requiring login, or example URLs that were never meant to resolve.

This article provides a step-by-step guide to minimize these issues, ensuring a quiet and useful link check.

To set up a link check in GitHub Actions, create a workflow file (.github/workflows/links.yml) with the following structure:

1. Define the workflow for pull requests and schedule it to run weekly.

2. Use the lychee-action version 2 with the --config option pointing to the lychee.toml configuration file located in the repository root.

3. In the lychee.toml config file:

a. Set max_concurrency to 16 and max_retries to 2 to avoid overwhelming rate-limited sites.

b. Specify acceptable HTTP status codes (200, 204, 206, and 429) as success responses, excluding 429 (Too Many Requests) for CI environments.

c. Define a list of URLs to exclude from checking (e.g., localhost, 127.0.0.1, example.com, org, net, and linkedin.com).

d. Specify file patterns to include (all Markdown and HTML files) and exclude (node_modules, vendor, and CHANGELOG.md) using glob patterns.

e. Set include_mail to false to only check for valid syntax in mailto: addresses.

To optimize the link check for pull requests, create a separate step in the workflow that:

1. Fetches changes from the base branch using git fetch.

2. Extracts the list of changed files (.md and .html) using git diff.

3. Executes lychee on the extracted files and reports failures if any broken links are found.

For scheduled runs (weekly sweep), modify the lychee action to incorporate caching and limit cache age to one day. This ensures frequent runs are fast, and old results are not cached for too long.

Lastly, create an issue with the broken links report when the scheduled run fails, using the create-issue-from-file GitHub Action. This way, you can easily manage and track the broken links in a separate issue instead of relying on the GitHub Actions status.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

My shop was invisible because of one line in robots.txt

I sell a small thing: a letter about a real place, written after walking it on Street View. One place, one walk, one letter to the person who asked for it. It costs about $1.20.

  • Shop invisible to search engines due to restrictive robots.txt file.
  • Owner discovered issue by testing robots.txt with Googlebot.
  • Suggested solution: move content to accessible host with place name in title.

Alt text for product images: what to write when every photo looks the same

Most alt text advice is written for blog photos. "A golden retriever catching a frisbee on a beach." Fine. But try that on a product page for a hardware store and it falls apart fast, because half the…

  • Avoid duplicating product title in main image alt text; add unique details not covered by title.
  • Leave alt text blank for decorative images to allow assistive technology to skip them.

Node.js Brings Debounce, Throttle, and PKCS#12 Parsing Into Core Modules

Node.js 26.10.0 adds util.debounce() and util.throttle(), plus util.markPromiseAsHandled(), to the core library. It also introduces crypto.parsePKCS12() for reading .p12 and .pfx bundles, and extends…

  • Node.js adds debounce() and throttle() functions to core libraries
  • PKCS#12 parsing API included in crypto module for private key extraction
  • Virtual File System expansion allows library loading from mounted instances

Security Audit Badges — What an Audit Covers, and What It Never Can

HostDeFi › Guides › Audit badges "Audited" is the most misread word in token marketing. It describes a code review with a date and a scope — not a background check on the people holding the keys.

  • Security audit badges do not guarantee audit credibility
  • Legitimate audit involves specific source files and graded findings
  • Badge legitimacy requires verification of auditor's website and contract addresses

Why red ink vanishes under a red sheet, and how I made an iPhone do it

I work on Red Sheet at W Lab. Students in Japan write answers in red or orange pen, lay a sheet of red plastic over the page, and the answers disappear while the black questions stay.

  • Red Sheet app conceals handwritten answers with red overlay
  • App identifies ink vs. paper using color analysis in CIELAB space
  • Pens hidden by red overlay, highlighters appear darker and block text

Should code comments link to Stack Overflow answers? Let's argue about it

Scheduled broken-link and redirect checks that tell you the moment a link breaks — linkbruno.com Open any mature codebase and search for stackoverflow.com .

  • Code comments linking to Stack Overflow answers spark debate
  • Links aid future maintainers by providing attribution and context
  • Links can rot over time, becoming outdated or broken

More from Saturday 14 November →