Interview Prep/GitHub Actions/Secrets, Variables, Environments & Permissions

What are the default `GITHUB_TOKEN` permissions, and how do you change them?

IntermediateConceptSecrets, Variables, Environments & Permissions
Answer

Repos and orgs created after February 2023 default to the restricted setting: contents: read and packages: read (metadata read always). Older ones may still default to permissive read/write on most scopes. Change the default in Settings, Actions, General, Workflow permissions (or at org/enterprise level so repos cannot loosen it), and declare permissions in every workflow anyway, so the file documents its needs and does not depend on the setting.

All GitHub Actions questions Roadmap: GitHub Actions

More on Secrets, Variables, Environments & Permissions