Skip to content

Commit 080440a

Browse files
committed
Refine GitHub Actions workflow to ensure link checks report errors correctly by adding failure handling for absolute and relative link checks
1 parent abeab7b commit 080440a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/check-links.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ jobs:
3131
id: check-absolute
3232
run: |
3333
# Only check absolute links (http/https), not relative links
34-
python docs/link_checker.py --dir docs/book --substring "http" --validate-links --timeout 15 --ci-mode
34+
python docs/link_checker.py --dir docs/book --substring "http" --validate-links --timeout 15 --ci-mode || true
3535
echo "exit_code=$?" >> $GITHUB_OUTPUT
36-
# Continue on error so both checks can run to completion
37-
continue-on-error: true
36+
- name: Check for failures
37+
if: steps.check-absolute.outputs.exit_code != '0'
38+
run: |
39+
echo "::error::Absolute links check failed. Please check the job logs for details."
40+
exit 1
3841
check-relative-links:
3942
if: github.event.pull_request.draft == false
4043
runs-on: ubuntu-latest
@@ -51,10 +54,13 @@ jobs:
5154
id: check-relative
5255
run: |
5356
# Check if relative links resolve within the repository
54-
python scripts/check_relative_links.py --dir docs/book
57+
python scripts/check_relative_links.py --dir docs/book || true
5558
echo "exit_code=$?" >> $GITHUB_OUTPUT
56-
# Continue on error so both checks can run to completion
57-
continue-on-error: true
59+
- name: Check for failures
60+
if: steps.check-relative.outputs.exit_code != '0'
61+
run: |
62+
echo "::error::Relative links check failed. Please check the job logs for details."
63+
exit 1
5864
summary:
5965
needs: [check-absolute-links, check-relative-links]
6066
if: always() && github.event.pull_request.draft == false

0 commit comments

Comments
 (0)