Skip to content

Commit d8e58e4

Browse files
committed
and another
1 parent 563130a commit d8e58e4

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/check-links.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ jobs:
3232
run: |
3333
# Only check absolute links (http/https), not relative links
3434
python docs/link_checker.py --dir docs/book --substring "http" --validate-links --timeout 15 --ci-mode
35-
# Store the exit code in a variable
36-
echo "exit_code=$?" >> $GITHUB_OUTPUT
37-
continue-on-error: true
38-
- name: Fail if links are broken
35+
# Capture the exit code even if the command fails
36+
EXIT_CODE=$?
37+
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
38+
# Don't exit with error yet, as we want to keep the exit code for the summary step
39+
exit 0
40+
- name: Mark job status based on check result
3941
if: steps.check-absolute.outputs.exit_code != '0'
40-
run: exit 1
42+
run: |
43+
echo "::error::Absolute links check failed! Found broken links."
44+
exit 1
4145
check-relative-links:
4246
if: github.event.pull_request.draft == false
4347
runs-on: ubuntu-latest
@@ -55,12 +59,16 @@ jobs:
5559
run: |
5660
# Check if relative links resolve within the repository
5761
python scripts/check_relative_links.py --dir docs/book
58-
# Store the exit code in a variable
59-
echo "exit_code=$?" >> $GITHUB_OUTPUT
60-
continue-on-error: true
61-
- name: Fail if links are broken
62+
# Capture the exit code even if the command fails
63+
EXIT_CODE=$?
64+
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
65+
# Don't exit with error yet, as we want to keep the exit code for the summary step
66+
exit 0
67+
- name: Mark job status based on check result
6268
if: steps.check-relative.outputs.exit_code != '0'
63-
run: exit 1
69+
run: |
70+
echo "::error::Relative links check failed! Found broken links."
71+
exit 1
6472
summary:
6573
needs: [check-absolute-links, check-relative-links]
6674
if: always() && github.event.pull_request.draft == false

0 commit comments

Comments
 (0)