How does `if` at step level differ from job level?
BeginnerConceptJobs, Steps, Matrix & Concurrency
Answer
Both accept expressions and get an implicit success() unless a status function is present. Job-level if is evaluated before a runner is assigned, so the steps and runner contexts are not available there, and env defined in the same job is not available either. Step-level if can use steps.*.outputs, env, runner.os and everything defined earlier in the job. You can omit ${{ }} in if, except when the expression starts with !, where YAML needs the braces or quotes.
More on Jobs, Steps, Matrix & Concurrency
How does `needs` work, and what happens to a job whose dependency failed or was skipped?BeginnerWhat is the implicit `success()` in a job `if`, and why is `always()` usually the wrong fix?IntermediateWhat 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?Beginner