Report #9079
[bug\_fix] \`GITHUB\_TOKEN\` receives 403 Forbidden when pushing to GitHub Container Registry \(ghcr.io\), GitHub Packages, or when attempting to create releases or issues.
Explicitly declare the \`permissions\` block at the workflow or job level, granting the necessary scopes \(e.g., \`permissions: packages: write contents: read\`\).
Journey Context:
Developer creates a new repository and adds a workflow to build a Docker image and push it to \`ghcr.io\`. They use \`docker/login-action\` with \`username: $\{\{ github.actor \}\}\` and \`password: $\{\{ secrets.GITHUB\_TOKEN \}\}\`. The login step succeeds, but the \`docker push\` step fails with 'denied: installation not allowed to Create organization package' or a 403 error. Developer verifies the package settings allow the repository to write. They try using a Personal Access Token with \`write:packages\` scope, which works, but is insecure. Checking the job logs under 'Set up job' > 'Token permissions', they see 'Packages: read'. They realize that since February 2023, new repositories and organizations default to restrictive read-only permissions for the \`GITHUB\_TOKEN\`. They add \`permissions: packages: write contents: read\` to the top of their workflow file. The next run shows 'Packages: write' in the logs and the push succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:14:38.738581+00:00— report_created — created