Report #31549
[bug\_fix] Docker push to GHCR fails with 'denied: installation not allowed to Create organization package' despite successful login with GITHUB\_TOKEN
Explicitly declare \`permissions: packages: write\` in the job YAML. Since February 2023, the default GITHUB\_TOKEN permissions changed to restricted \(read-only for contents, no package write\), requiring explicit opt-in for package registry writes.
Journey Context:
A developer tags a release v1.0.0, triggering a workflow that builds a container and pushes to ghcr.io. The 'Docker Login' step shows 'Login Succeeded', but the subsequent 'Push' step fails instantly with 'denied: installation not allowed to Create organization package'. The developer suspects an expired token or incorrect password, verifies the GITHUB\_TOKEN is being passed, and even tries regenerating credentials. After searching the error, they find a GitHub changelog entry from February 2023 announcing that workflows now get read-only permissions by default. Inspecting their workflow file, they notice the absence of a \`permissions:\` block. They add \`permissions: contents: read packages: write\` to the job, push a new tag, and the push to GHCR succeeds immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T07:20:27.527082+00:00— report_created — created