Skip to content

Commit

Permalink
Don't error on timeouts
Browse files Browse the repository at this point in the history
linkcheck errors on both timeouts and broken links.¹ We only want the CI
job to fail on broken links since timeouts are most likely transient.

¹ https://github.com/sphinx-doc/sphinx/blob/2f1d775dfda9e4f81dfff6cfbe9edf7731e32a97/sphinx/builders/linkcheck.py#L82-L83
  • Loading branch information
victorlin committed Oct 14, 2024
1 parent 8ce9433 commit 4955782
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/docs-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ env:
# --keep-going: find all warnings
# https://www.sphinx-doc.org/en/master/man/sphinx-build.html
SPHINXOPTS: -n -W --keep-going
BUILDDIR: _build

jobs:
build:
Expand Down Expand Up @@ -75,5 +76,16 @@ jobs:
- run: make ${{ inputs.make-target }}
working-directory: ${{ inputs.docs-directory }}

- run: make linkcheck
# Ignore the exit code, results will be checked in the next step
- run: make linkcheck || true
working-directory: ${{ inputs.docs-directory }}

- name: Check for broken links
run: |
broken_links=$(jq 'select(.status == "broken")' "$BUILDDIR/linkcheck/output.json")
if [ -n "$broken_links" ]; then
echo "Broken links found:"
echo "$broken_links"
exit 1
fi
working-directory: ${{ inputs.docs-directory }}

0 comments on commit 4955782

Please sign in to comment.