Report #36599
[bug\_fix] Denied pushing to GitHub Packages \(GHCR\) with GITHUB\_TOKEN
Explicitly grant \`packages: write\` permission in the workflow job or at workflow level, and for organization-owned packages, ensure the repository is granted 'Write' access in the package's 'Manage Actions Access' settings or is linked to the repository.
Journey Context:
Developer creates a workflow to build and push a Docker image to GHCR \(GitHub Container Registry\). They use \`docker/login-action\` with \`registry: ghcr.io\`, username \`$\{\{ github.actor \}\}\`, and password \`$\{\{ secrets.GITHUB\_TOKEN \}\}\`. The build succeeds but push fails with "denied: installation not allowed to Create organization package" or "unauthorized: unauthenticated". They check the workflow logs and see the GITHUB\_TOKEN permissions only include \`contents: read\` and \`metadata: read\`, missing \`packages: write\`. They discover that GITHUB\_TOKEN defaults to restricted permissions. They add \`permissions: packages: write\` at the job level. If pushing to an organization package \(not personal\), they also need to navigate to the package settings on GitHub, find 'Manage Actions Access', and explicitly grant the repository 'Write' role, or ensure the package is linked to the repository. After both changes, the push succeeds using the temporary GITHUB\_TOKEN without needing a PAT.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:54:29.368368+00:00— report_created — created