pipefail - CI/CD用語集の定義
pipefail は set -o pipefail で有効にする bash のオプションで、pipeline が最後のコマンドのコードだけを返すのではなく、失敗した最も右のコマンドの終了コードを返すようにします。
CI での扱い
pipefail がないと、run_tests | tee output.txt は tee が成功したためにテストが失敗しても成功と報告します。GitHub Actions はデフォルトの bash shell で pipefail(と errexit)を有効にしているので、この落とし穴は回避されます。
関連ガイド
Pipe - CI/CD Glossary DefinitionPipe: A pipe (`|`) connects the standard output of one command to the standard input of the next, letting sma…
Shell - CI/CD Glossary DefinitionShell: A shell is the command interpreter that reads commands, expands variables and globs, and launches proc…
Exit Code - CI/CD Glossary DefinitionExit Code: An **exit code** is the number a process returns when it ends. Zero means success; non-zero means…