Skip to content

Commit 7a7892e

Browse files
authored
fix: docs build to throw error if fails (#1100)
* fix: docs build to throw error if fails * docs: members init should be array
1 parent 2282658 commit 7a7892e

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 10 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,12 @@ 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+
exit 1
45+
fi

docs/getting-started/parameters.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ All parameters are documented below:
1919

2020
::: codecarbon.emissions_tracker.BaseEmissionsTracker
2121
options:
22-
members: __init__
22+
members:
23+
- __init__
2324
merge_init_into_class: true
2425
show_root_heading: true
2526
show_signature: false
@@ -30,7 +31,8 @@ All parameters are documented below:
3031

3132
::: codecarbon.emissions_tracker.OfflineEmissionsTracker
3233
options:
33-
members: __init__
34+
members:
35+
- __init__
3436
merge_init_into_class: true
3537
show_root_heading: true
3638
show_signature: false

0 commit comments

Comments
 (0)