What is GITHUB_TOKEN and how is it made available in a GitHub Actions workflow?
Select an answer to reveal the explanation.
Short Explanation and Infographic
GITHUB_TOKEN is GitHub's automatic babysitter — it's created fresh for every run, scoped to the current repo, and expires when the run ends.
Full explanation below image
Full Explanation
GitHub automatically creates a unique GITHUB_TOKEN for each workflow run. It's a GitHub App installation token scoped to the repository where the workflow runs. It's available as 'secrets.GITHUB_TOKEN' in expressions and as the GITHUB_TOKEN environment variable. Permissions can be restricted using the 'permissions:' block. The token expires when the workflow job completes. It cannot access other repositories by default. You don't create it — GitHub creates it automatically. This allows workflows to interact with the GitHub API (create issues, push packages, etc.) without manual credential management.