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

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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Jobs, Steps, Matrix & Concurrency