GitHub Actions pipeline failure hidden without pipefail (custom shell)
By Kaveh Alemi·Latchkey
The default bash shell sets pipefail, so a failing command in a pipe fails the step. Overriding shell (for example shell: bash -e {0} without -o pipefail) drops pipefail and hides upstream failures.
What this error means
A pipeline like cmd1 | cmd2 reports success even though cmd1 failed, because a custom shell setting removed pipefail.
github-actions
# step "passes" even though build fails, because cmd2 succeeds:
shell: bash -e {0}
run: ./build.sh | tee build.log
Common causes
Custom shell drops pipefail
Overriding shell without -o pipefail evaluates only the last command status.
Relying on default but using a different shell
sh or another shell may not enable pipefail by default.
How to fix it
Restore pipefail
Use the default bash shell, which already sets pipefail.
If you override shell, include -o pipefail.
Verify a failing left side of a pipe fails the step.
.github/workflows/ci.yml
- shell:bashrun:|set -o pipefail./build.sh | tee build.log
How to prevent it
Prefer the default shell unless you have a specific reason to override it.
Always include -o pipefail when customizing the shell.
Frequently asked questions
What causes "missing pipefail in pipe"?
Overriding shell without -o pipefail evaluates only the last command status.