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.
More on Jobs, Steps, Matrix & Concurrency
How does `needs` work, and what happens to a job whose dependency failed or was skipped?BeginnerWhat values can `needs.<job>.result` take?BeginnerHow does a matrix expand, and how are job names generated?BeginnerHow do `include` and `exclude` work in a matrix?IntermediateWhat do `fail-fast` and `max-parallel` do?BeginnerHow do you build a matrix dynamically from a previous job?Advanced