October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Broken-Link Checks in CI: Make Failed Links Block a Release

A reliable broken-link gate scans the generated files that will ship, fails CI on checker errors, and uses narrow, documented exceptions for unreliable endpoints.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make CI refuse to publish a site with broken links, run a link checker as a required build step and let its nonzero exit status fail the workflow. For a generated site, scan the generated output—not just the source files—so the check covers the links that will actually ship.

Where should the link check run?

Choose a scan target that represents the published artifact. Lychee accepts directories, explicit files and website URLs, and supports Markdown, HTML, reStructuredText and other text inputs. If your build generates a site, run Lychee against that output directory after generation: a source-only scan can miss links added or changed during the build. Lychee’s documentation describes supported inputs and options.

As an Amazon Associate I earn from qualifying purchases.

How do I make CI fail when a link is broken?

Run the checker in the build workflow and make its result a required condition for publication. Lychee’s command-line tool returns exit code 2 when it finds link-check failures; 0 means success, while 1 and 3 indicate runtime/input or configuration problems. A CI job that stops on nonzero status will therefore block later publishing steps on a broken link or a checker problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the command-line tool

Run Lychee against the generated output directory in a shell step after the build and before deployment. Replace dist with the actual output path in your project:

#1 Best Overall
Freestyle 5 Books of Freestyle Self Testing Log Book Total 5 Books
  • The FreeStyle log book includes sections for: Lunch, Dinner, Bedtime, Night
  • Comments for each day of the week
  • Log Book Dimensions L=4.25" x W=3.12" x H=0.12"
  • Contains 5 book
lychee dist/

Ensure the workflow does not swallow the command’s exit code—for example, avoid marking the step as allowed to fail or appending a construct that forces success. Keep deployment dependent on the successful check.

Use the GitHub Action

The lychee-action README documents workflow examples and controls including fail and failIfEmpty. Set fail to true so a nonzero Lychee result fails the workflow; consider failIfEmpty if finding no links should also count as an error. Use the action’s documented arguments to point the scan at your generated output.

Setting fail: false makes the workflow non-blocking. That can be useful for an intentionally advisory rollout, but it does not meet the requirement to refuse publication when checks fail.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How should the check fit into the build?

  1. Build the site. Generate the files that will be published.
  2. Check the generated files. Run Lychee on the output directory or the specific generated files containing links.
  3. Publish only after success. Make deployment depend on the check passing, and preserve its failure status in the workflow.
  4. Keep local and CI behavior aligned. Use a local Lychee version reasonably close to the pinned CI version. The OpenTelemetry project describes using Lychee locally while CI installs its own pinned copy. OpenTelemetry’s project configuration illustrates that approach.

How can you keep external-link checks reliable?

A failed request does not always mean a link is permanently broken. Third-party servers may reject automated requests, rate-limit clients or respond inconsistently. Tune the checker to reduce avoidable false alarms, while treating these controls as mitigations rather than guarantees.

  • Request method: Lychee documents configuring methods, including a head,get sequence for endpoints that reject HEAD requests.
  • Timeouts and caching: Set an appropriate timeout and use caching to reduce repeated network requests. The action also documents cache configuration.
  • Fragments: Checking a URL fragment requires the response body. Lychee does not perform fragment checks when a link succeeds through a non-GET request.
  • Exclusions: Use Lychee exclusion patterns or a .lycheeignore file for narrowly defined exceptions. Record why each exception exists and review it periodically.

For an endpoint that remains unreliable, decide whether the exception is acceptable for your site and document it narrowly. An ever-growing ignore list can quietly turn a blocking check into a bypass.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What should be maintained over time?

The lychee-action project recommends pinning the action to a fixed version and keeping it updated with Dependabot; its example also demonstrates pinning to a commit SHA. Review dependency updates through your normal workflow rather than relying on an unpinned moving reference. Keep the local checker reasonably close to the CI version so developers can reproduce results before pushing.

Configuration options and action versions can change. Check the current project documentation when implementing or updating the workflow, especially for action inputs, supported arguments and reporting options.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.