Skip to content
Latchkey

GitHub Actions pipeline failure hidden without pipefail (custom shell)

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

  1. Use the default bash shell, which already sets pipefail.
  2. If you override shell, include -o pipefail.
  3. Verify a failing left side of a pipe fails the step.
.github/workflows/ci.yml
- shell: bash
  run: |
    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.
How do I fix missing pipefail in pipe?
Restore pipefail

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card