Interview Prep/GitHub Actions/Jobs, Steps, Matrix & Concurrency

What is the implicit `success()` in a job `if`, and why is `always()` usually the wrong fix?

IntermediateConceptJobs, Steps, Matrix & Concurrency
Answer

Any job if without a status function gets an implicit success() && prefix, so if: github.ref == 'refs/heads/main' really means success() && github.ref == .... The confusion is the opposite case: people write if: always() && ... to handle a skipped optional dependency and then the job runs even after a real failure, or even after the run is cancelled. Prefer !cancelled() over always(), and check needs.<job>.result explicitly for each dependency.

All GitHub Actions questions Roadmap: GitHub Actions

More on Jobs, Steps, Matrix & Concurrency