Commit 1e21fd1
authored
fix(ci): make dead links workflow robust against silent curl failures (#2534)
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 debuggability1 parent b545a38 commit 1e21fd1
1 file changed
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
25 | 43 | | |
26 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
27 | 53 | | |
28 | 54 | | |
29 | 55 | | |
| |||
34 | 60 | | |
35 | 61 | | |
36 | 62 | | |
37 | | - | |
| 63 | + | |
38 | 64 | | |
0 commit comments