fix(ci): make dead links workflow robust against silent curl failures#2534
Merged
BrendanWalsh merged 1 commit intomasterfrom Mar 31, 2026
Merged
fix(ci): make dead links workflow robust against silent curl failures#2534BrendanWalsh merged 1 commit intomasterfrom
BrendanWalsh merged 1 commit intomasterfrom
Conversation
The 'Scan Website for Dead Links' CI job was failing because it found 0 URLs in the sitemap. Root cause: curl -s was silently failing (no error output) and the pipeline had no error checking, so the step appeared to succeed with an empty urls.txt. Changes: - Add 'set -euo pipefail' for strict error handling - Download sitemap to a file with --compressed and --retry for reliability (fixes potential gzip encoding issues) - Check HTTP status code and fail explicitly on non-200 - Switch from grep -oP (PCRE) to grep -oE (POSIX ERE) for portability across runner environments - Validate URL count before proceeding to lychee scan - Remove extra single quotes around --accept value in lychee args that could cause parsing issues in YAML block scalars - Log sitemap size and dump content on failure for debuggability
|
Hey @BrendanWalsh 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Scan Website for Dead Links CI job has been consistently failing with:
The workflow fetches sitemap URLs from GitHub Pages, but
curl -swas silently failing — producing no output and no error — so the grep pipeline generated an emptyurls.txt, which caused lychee to report 0 links.Root Cause
Multiple issues compounded:
curl -shides errors — network failures, DNS issues, or encoding mismatches produced no diagnostic outputpipefail— grep failures in the pipeline were silently swallowedgrep -oP(PCRE) — less portable than POSIX extended regex; may behave differently across runner environmentsurls.txtwas passed to lychee, which correctly rejected it--acceptvalue — extra single quotes around the range value in the YAML block scalar could cause lychee argument parsing issuesFix
set -euo pipefailfor strict error handling--compressedand--retry 3for reliabilitygrep -oP(PCRE) togrep -oE(POSIX ERE) for portability--acceptvalueTesting
Verified locally: the sitemap at
https://microsoft.github.io/SynapseML/sitemap.xmlreturns 344KB / 1821 URLs, and the fixed extraction pipeline handles it correctly.