GitHub Actions "Process completed with exit code 1" in run with set -e
GitHub Actions runs bash steps with set -e -o pipefail by default. Any command that returns non-zero - even one whose failure you intended to tolerate - aborts the step with exit code 1.
What this error means
A run step fails immediately after a command returns non-zero, including commands like grep with no match, which exit 1 by design.
github-actions
+ grep "WARN" build.log
Error: Process completed with exit code 1.Common causes
set -e aborts on first non-zero
The default bash flags stop the step on any failing command.
Tolerable failures not handled
Commands like grep, diff, or test that legitimately exit non-zero abort the step.
How to fix it
Handle expected non-zero exits
- Append || true to commands whose non-zero result is acceptable.
- Capture and inspect the exit code explicitly when you need to branch.
- Use continue-on-error only when the whole step may legitimately fail.
.github/workflows/ci.yml
- run: |
if grep -q "WARN" build.log; then
echo "warnings present"
fi # if/grep -q avoids aborting on no-matchHow to prevent it
- Remember bash steps run with errexit and pipefail by default.
- Guard tolerable failures rather than disabling error handling globally.
Related guides
GitHub Actions pipeline failure hidden without pipefail (custom shell)Fix a GitHub Actions run where a failing command in a pipe is ignored - a custom shell without pipefail only…
GitHub Actions multiline run script fails (YAML block scalar)Fix a GitHub Actions multiline run that breaks - the YAML block scalar indicator or indentation mangled the s…
GitHub Actions env var with special characters not escapedFix a GitHub Actions env value containing special characters that breaks the shell - quoting and escaping are…