Skip to content

Commit d0376a2

Browse files
committed
fix: docs build to throw error if fails
1 parent 9be333a commit d0376a2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/build-docs.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
paths:
1515
- "docs/**"
1616
- "mkdocs.yml"
17+
- ".github/workflows/build-docs.yml"
1718

1819
jobs:
1920
build:
@@ -33,4 +34,13 @@ jobs:
3334
run: uv sync --group doc
3435

3536
- name: Build docs
36-
run: uv run zensical build -f mkdocs.yml --clean
37+
run: |
38+
set -euo pipefail
39+
# Run zensical and capture output, fail if command exits non-zero
40+
uv run zensical build -f mkdocs.yml --clean 2>&1 | tee docs_build.log
41+
# If output contains common error indicators, fail the step.
42+
if grep -Ei "\b(error|failed|traceback|exception)\b" docs_build.log >/dev/null; then
43+
echo "Documentation build produced errors; failing workflow."
44+
tail -n 200 docs_build.log
45+
exit 1
46+
fi

0 commit comments

Comments
 (0)