I have a workflow that does a checkout, runs a script, and creates a PR if a git diff has new content. git diff returns exit code 1 when there are changes in quiet mode , which I test for in the next step using
failure() and run my PR code.
However, even when I’ve successfully run my step on failure, the action (scheduled to run each night) still reports overall failure. How can I set this job status to success overall even though one step returned an error code?
- name: diff content directory run: git diff --quiet archives/content/ - name: PR if changes exist run: <some conditional commands to PR changes here> if: failure()