Interview Prep/GitHub Actions/Expressions, Outputs, Matrix & Conditions

A step with `run: npm test | tee test.log` passes even though tests failed.

IntermediateTroubleshootingExpressions, Outputs, Matrix & Conditions
Answer

Likely causes → Default shell is bash -e {0} without pipefail, so the pipeline's exit code is tee's (0).

Diagnose → Check the "Run" header in logs: shell: /usr/bin/bash -e {0}.

Fix → Set shell: bash (adds -o pipefail) on the step or in defaults.run, or set -o pipefail in the script.

Prevent → Workflow-level defaults: run: shell: bash.

All GitHub Actions questions Roadmap: GitHub Actions

More on Expressions, Outputs, Matrix & Conditions