Skip to content

Commit 3e0c1c5

Browse files
committed
Fix CI: Handle grep exit code when filtering settings.rst
When settings.rst is the only changed file, grep -v returns exit code 1 because there are no matches after filtering. Adding '|| true' ensures the pipeline continues and correctly identifies no relevant changes.
1 parent bd8319b commit 3e0c1c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ jobs:
4343
# this will update docs/source/settings.rst - but will not create html output
4444
(cd docs && sphinx-build -b "dummy" -d _build/doctrees source "_build/dummy")
4545
# Check for uncommitted changes, excluding settings.rst which is auto-generated
46-
if unclean=$(git status --untracked-files=no --porcelain | grep -v "docs/source/settings.rst") && [ -z "$unclean" ]; then
46+
# Use grep -v to filter out settings.rst; if grep returns 1 (no matches), that's OK
47+
unclean=$(git status --untracked-files=no --porcelain | grep -v "docs/source/settings.rst" || true)
48+
if [ -z "$unclean" ]; then
4749
echo "no uncommitted changes in working tree (as it should be)"
4850
else
4951
echo "did you forget to run `make -C docs html`?"

0 commit comments

Comments
 (0)