Report #67762
[bug\_fix] denied: installation not allowed to Write organization package or 403 Resource not accessible by integration when pushing to GHCR
Add explicit permissions block to the workflow YAML: \`permissions: packages: write, contents: read\`. Root cause: GitHub changed the default GITHUB\_TOKEN permissions to restricted in February 2023; workflows must now explicitly declare required permissions to write packages or modify repository contents.
Journey Context:
You set up a workflow to build and push a Docker image to GitHub Container Registry. The docker/login-action succeeds, but the push step fails with "denied: installation not allowed to Write organization package". You verify the GITHUB\_TOKEN is being used, not a PAT, and check repository settings for packages. Searching the error leads you to GitHub's 2023 changelog about restricted default token permissions. You realize the workflow lacks a permissions block, causing the token to default to read-only. After adding \`permissions: packages: write, contents: read\`, the push succeeds because the token now carries the necessary scopes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:13:20.317789+00:00— report_created — created