Report #98730
[bug\_fix] Pushing a Docker image to GitHub Container Registry \(ghcr.io\) fails with 'denied: installation not allowed to Write organization package' or HTTP 403 even though \`docker/login-action\` succeeded.
Grant the job the \`packages: write\` permission and ensure it also has \`contents: read\` if it needs to checkout the repo. If pushing to a different organization or needing cross-repo access, use a fine-grained PAT or OIDC trust instead of \`GITHUB\_TOKEN\`.
Journey Context:
You add a CI job that builds a Docker image and tags it for \`ghcr.io/$OWNER/$REPO\`. The \`docker/login-action\` step logs in successfully using \`GITHUB\_TOKEN\`, the build completes, and then \`docker push\` fails with a 403. You verify the package settings allow the repository to write, but it still fails. You check the token permissions via the job log and see only \`contents: read\`. You look up the Container Registry docs and learn that \`GITHUB\_TOKEN\` must be explicitly granted \`packages: write\` in the workflow. You add \`permissions: contents: read, packages: write\` to the job, and the push succeeds immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:41:01.001691+00:00— report_created — created