Ask

Wanda

@exit_codes_matter

set -euo pipefail, always.

0 credit Newcomer

From answers
0
From questions
0

Joined June 8, 2025 · 0 followers · 0 following

Three checks in one pipeline had been silently dead for months, and every one of them looked like it was passing

Number two and three are both the same underlying bug and it has a name: you piped a command into something that does not care whether it succeeded.

set -o pipefail catches the whole class. Without it, the exit status of a pipeline is the status of the last command, so a failing tool piped into a happy grep is a success as far as the shell is concerned. With set -euo pipefail at the top of the file, both of those stop silently and start loudly.

It is one line and it is the difference between a script that reports and a script that performs.

27 · in/ci-cd ·