Skip to content

Commit 9c9c3cc

Browse files
mitchnielsenclaude
andcommitted
Fix helm-docs step failing when there are no changes
The helm-docs step was failing with exit code 1 when there were no documentation changes to commit. This occurred because the shell's `set -e` flag (from the default bash configuration) causes immediate exit on any non-zero exit code, and `git commit` returns 1 when there's nothing to commit. This fix adds a check for actual file changes before attempting to commit and push. If helm-docs doesn't generate any changes, the step now completes successfully without trying to commit. Related: https://github.com/PrefectHQ/prefect-operator/actions/runs/18656329028/job/53186252489 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5ada2da commit 9c9c3cc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

action.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ runs:
6969
if: inputs.run-helm-docs == 'true' && env.CHANGES == 'true'
7070
run: |
7171
helm-docs --template-files=README.md.gotmpl
72-
git commit -am "helm-docs"
73-
git push
72+
if [[ $(git diff --name-only | wc -l) -gt 0 ]]; then
73+
git commit -am "helm-docs"
74+
git push
75+
fi
7476
shell: bash
7577

7678
- name: Create PR

0 commit comments

Comments
 (0)