Interview Prep/CI/CD/GitHub Actions

What is the `GITHUB_TOKEN` and how should you scope it?

IntermediateConceptGitHub Actions
Answer

GITHUB_TOKEN is an automatically created, short-lived token for each job, scoped to the repository. Its default permissions depend on repo/org settings, so set the default to read-only and grant per workflow or job with permissions:. Anything not listed becomes none once you declare permissions.

permissions:
  contents: read
jobs:
  release:
    permissions:
      contents: write
      packages: write
      id-token: write
All CI/CD questions

More on GitHub Actions