Report #86227
[bug\_fix] denied: installation not allowed to Write organization package or 403 Resource not accessible when pushing to GHCR using GITHUB\_TOKEN
Add explicit permissions block to the workflow job: \`permissions: packages: write contents: read\` \(and \`id-token: write\` if using OIDC\), or change repository Settings > Actions > General > Workflow permissions to 'Read and write permissions'. Root cause: GitHub changed the default GITHUB\_TOKEN permissions to read-only for new repositories in 2023; the token lacks package:write scope by default.
Journey Context:
Developer pushes a new workflow that builds and pushes a Docker image to ghcr.io. The build succeeds but the push fails with 'denied: installation not allowed to Write organization package'. They check the PAT but realize they're using GITHUB\_TOKEN. They search and find GitHub's changelog from February 2023 about default permission changes. They check the repository Settings > Actions > General and see 'Workflow permissions' is set to 'Read repository contents and packages permissions'. They change it to 'Read and write permissions' OR they add \`permissions: packages: write contents: read\` to the workflow YAML. The next run succeeds because the token now has the necessary scope.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:19:17.859229+00:00— report_created — created