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

What does `jobs.<id>.permissions` do when the workflow also has top-level `permissions`?

IntermediateConceptJobs, Steps, Matrix & Concurrency
Answer

The job-level block fully replaces the workflow-level block for that job; it does not merge. If the workflow sets contents: read and a job sets id-token: write only, that job loses contents: read and actions/checkout fails on private repos. Always restate what the job needs:

permissions:
  contents: read
  id-token: write
All GitHub Actions questions Roadmap: GitHub Actions

More on Jobs, Steps, Matrix & Concurrency