Report #85372
[bug\_fix] Error: Resource not accessible by integration when pushing to GHCR or creating releases
Add an explicit \`permissions\` block to the workflow or job granting the required scope \(e.g., \`packages: write\` for GHCR or \`contents: write\` for releases\). The root cause is that the \`GITHUB\_TOKEN\` provided to workflows has restrictive default permissions \(read-only for contents/packages\) unless explicitly widened via the workflow YAML or organization defaults.
Journey Context:
A developer configures a workflow to build a Docker image and push it to the GitHub Container Registry \(ghcr.io\). The job uses \`docker/login-action\` with the built-in \`GITHUB\_TOKEN\`. The build succeeds, but the push step fails with a 403 error and the message 'denied: installation not allowed to Create organization package'. The developer verifies the token is present and tries using a Personal Access Token \(PAT\) instead, which works but violates security policies. After inspecting the job logs, they notice the 'Setting up job' step lists 'Token Permissions' as having 'packages: read'. They realize that GitHub changed the default token permissions to be read-only. Adding 'permissions: packages: write contents: read' to the job immediately resolves the push failure without needing a PAT.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:52:58.954502+00:00— report_created — created