Report #53419
[bug\_fix] Resource not accessible by integration \(403\) when pushing to GHCR or creating releases despite using GITHUB\_TOKEN
Add explicit \`permissions\` block at the workflow or job level granting specific scopes \(e.g., \`packages: write\` for GHCR, \`contents: write\` for releases, \`pull-requests: write\` for comments\). This overrides the repository default, which was changed to read-only for new repositories and enterprises in February 2023.
Journey Context:
A developer configures a workflow to build a Docker image and push it to GHCR using \`docker/login-action\` with \`password: $\{\{ secrets.GITHUB\_TOKEN \}\}\`. The login step succeeds, but the push fails with a 403 'denied' or 'Resource not accessible by integration' error. The developer regenerates the token, checks repository secrets, and verifies package permissions in the UI, but the error persists. After searching the error message, they discover that GitHub changed the default \`GITHUB\_TOKEN\` permissions to restrictive \(read-only for contents and packages\). The developer adds \`permissions: packages: write contents: read\` at the job level. The workflow now succeeds because the token is explicitly granted the necessary scope to push packages.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:09:39.357665+00:00— report_created — created