Skip to content

Commit 32182f1

Browse files
tghosthclaude
andcommitted
Use continue-on-error so curl retry can rescue the job
The `if: failure()` approach ran the retry step but couldn't change the job outcome. Using `continue-on-error: true` with step ID lets the retry step determine the final pass/fail result. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 681e7b5 commit 32182f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/url-checker.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
cat /tmp/files_to_check.txt
3838
3939
- name: Check URLs
40+
id: linkcheck
41+
continue-on-error: true
4042
run: |
4143
set -o pipefail
4244
ERROR_FOUND=0
@@ -56,7 +58,7 @@ jobs:
5658
fi
5759
5860
- name: Retry status-0 failures with curl
59-
if: failure()
61+
if: steps.linkcheck.outcome == 'failure'
6062
run: |
6163
echo "Retrying status-0 (connection failure) URLs with curl..."
6264
DEAD_LINKS=0
@@ -65,7 +67,7 @@ jobs:
6567
grep -oP '\[✖\] \Khttps?://\S+(?= → Status: 0)' /tmp/link-check-output.txt > /tmp/status0-urls.txt || true
6668
6769
if [ ! -s /tmp/status0-urls.txt ]; then
68-
echo "No status-0 failures found to retry."
70+
echo "No status-0 failures found to retry - all failures are genuine dead links."
6971
exit 1
7072
fi
7173

0 commit comments

Comments
 (0)