Report #55432
[bug\_fix] Error: denied: installation not allowed to Write organization package or 403 Resource not accessible by integration when pushing to GHCR or creating releases
Add explicit permissions block at workflow or job level: \`permissions: contents: write packages: write\`. Root cause: Since February 2023, GitHub changed the default \`GITHUB\_TOKEN\` permissions to read-only for new repositories/organizations to improve security, breaking workflows that assumed write access.
Journey Context:
Developer pushes a workflow that builds a Docker image and pushes to GHCR. It works locally with a PAT, but in CI it fails with a cryptic 403 'Resource not accessible by integration'. They verify the token is present \(GITHUB\_TOKEN is automatic\). They check repository Settings > Actions > General > Workflow permissions and see it's set to 'Read repository contents and packages' \(the new default\). They initially consider changing the repository default to 'Read and write', but realize this is a security risk for all workflows. Instead, they add \`permissions: packages: write contents: read\` to the specific job. The workflow immediately succeeds because the temporary token now has the explicit scopes required for that job only, without changing the repository default.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:32:03.671956+00:00— report_created — created