Report #47576
[bug\_fix] Resource not accessible by integration \(403\) when pushing to GHCR or creating releases using GITHUB\_TOKEN
Add an explicit \`permissions\` block at the job or workflow level granting \`packages: write\` and/or \`contents: write\` to the \`GITHUB\_TOKEN\`.
Journey Context:
A developer configures a workflow to build a container and push to \`ghcr.io\` using \`GITHUB\_TOKEN\` for authentication. The docker login step succeeds, but the push fails with 'denied: Resource not accessible by integration'. They verify the token is present in the environment \(it appears as \`\*\*\*\` in logs\). They check repository settings for package visibility and ensure the workflow has write access to packages, but the error persists. After searching, they find a GitHub issue explaining that the default permissions for the \`GITHUB\_TOKEN\` were changed to read-only for new repositories and organizations. They realize the workflow YAML must explicitly request write permissions. They add \`permissions: packages: write contents: read\` to the job, after which the push to GHCR succeeds immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:20:40.945208+00:00— report_created — created