Report #53565
[bug\_fix] Permission denied when pushing to GitHub Container Registry or committing changes using GITHUB\_TOKEN
Add explicit permissions block to the job or workflow: \`permissions: contents: write packages: write\` to override the default read-only token
Journey Context:
Developer sets up a workflow to build and push a Docker image to ghcr.io. The build succeeds but the push fails with 'denied: permission\_denied'. They check secrets - GITHUB\_TOKEN is present. They try adding explicit credentials - same error. Searching the debug logs, they see 'Token permissions: read'. They discover GitHub changed default token permissions to read-only in February 2023 for new repositories. The workflow lacks explicit permissions, so the token cannot write packages. Adding \`permissions: packages: write contents: read\` explicitly grants the required scopes, overriding the restrictive defaults and allowing the push to succeed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:24:28.668482+00:00— report_created — created