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

What is the difference between job-level `env` and `steps[*].env`, and can a job's `env` reference `matrix`?

BeginnerConceptJobs, Steps, Matrix & Concurrency
Answer

Workflow env applies to all jobs, job env to all steps in that job, step env to that step; the most specific wins. Job env can use matrix, needs, vars, secrets, inputs and github. It cannot reference other keys in the same env map or steps outputs (they do not exist yet at that level).

env:
  NODE_VERSION: ${{ matrix.node }}
  IMAGE: ${{ vars.ECR_REGISTRY }}/shack-api
All GitHub Actions questions Roadmap: GitHub Actions

More on Jobs, Steps, Matrix & Concurrency