Skip to content

Commit 4d74925

Browse files
committed
Docs CI: re-emit sphinx warnings as GitHub annotations on failure
Previous attempt uploaded the log as an artifact but the public artifacts API returns 0 artifacts for failed runs without auth. Add a failure-only step that cats the log to stdout and re-emits matching WARNING/ERROR lines as ::error:: annotations, which ARE exposed via the public check-run annotations API.
1 parent 707fb24 commit 4d74925

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,31 @@ jobs:
7373
- name: Build HTML docs (warnings-as-errors)
7474
working-directory: UniROS
7575
run: |
76+
mkdir -p docs/_build
7677
set -o pipefail
7778
sphinx-build -W --keep-going -b html docs docs/_build/html 2>&1 | tee docs/_build/sphinx.log
7879
80+
- name: Surface sphinx warnings as annotations
81+
if: failure()
82+
working-directory: UniROS
83+
run: |
84+
echo "===== sphinx.log ====="
85+
cat docs/_build/sphinx.log || echo "(no log file)"
86+
echo "===== warning lines ====="
87+
grep -nE "(WARNING|ERROR)" docs/_build/sphinx.log || echo "(no warnings matched)"
88+
# Re-emit as GitHub annotations so they surface via the check-run API.
89+
while IFS= read -r line; do
90+
echo "::error::${line}"
91+
done < <(grep -E "(WARNING|ERROR)" docs/_build/sphinx.log || true)
92+
7993
- name: Upload sphinx build log
8094
if: always()
8195
uses: actions/upload-artifact@v4
8296
with:
8397
name: sphinx-log
8498
path: UniROS/docs/_build/sphinx.log
8599
retention-days: 14
100+
if-no-files-found: warn
86101

87102
- name: Upload built docs as artifact
88103
if: success()

0 commit comments

Comments
 (0)