Report #6119
[bug\_fix] Push to GitHub Container Registry fails with 'denied: installation not allowed to Write organization package' despite successful docker login
Add explicit permissions block granting \`packages: write\` and \`contents: read\` to the job, or change the default workflow permissions at the organization/repository level from 'Read repository contents' to 'Read and write'.
Journey Context:
The workflow successfully authenticates to ghcr.io using the GITHUB\_TOKEN, but the subsequent docker push returns a 403 Forbidden with 'denied: installation not allowed to Write organization package'. The developer first suspects the token is expired or lacks package:write scope, regenerates the GITHUB\_TOKEN \(which is automatic\), and even tries creating a Personal Access Token \(PAT\) with full packages:write scope, which works but is insecure. After digging into the Actions logs, they notice the token permissions only list 'contents: read'. They realize GitHub changed the default workflow permissions to restrictive read-only in February 2023. The fix is adding \`permissions: packages: write contents: read\` at the job level, explicitly granting the required scope without changing global settings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:13:11.778986+00:00— report_created — created