Interview Prep/Git & GitHub/GitHub features, history rewriting and scale

What are the permissions of `GITHUB_TOKEN` and how do you restrict them?

IntermediateConceptGitHub features, history rewriting and scale
Answer

It is a per-run token with repo-scoped permissions. Set the default to read-only in org settings and grant only what each workflow needs with a permissions: block.

permissions:
  contents: read
  pull-requests: write
All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub features, history rewriting and scale