Report #46540
[bug\_fix] 403 Resource not accessible by integration when pushing to GitHub Container Registry \(GHCR\) using GITHUB\_TOKEN
Add an explicit \`permissions\` block to the job granting \`packages: write\` \(and \`contents: read\` if reading the repo\), or change the repository default workflow permissions to 'Read and write' in Settings > Actions > General.
Journey Context:
Developer creates a workflow to build and push a Docker image to GHCR using \`docker/build-push-action\`. The login step succeeds, but the push step fails with '403 Forbidden' or 'Resource not accessible by integration'. Developer verifies they are using \`secrets.GITHUB\_TOKEN\` and that the package exists. After checking the workflow run logs, they notice the token permissions only show \`packages: read\`. They check the repository settings and find that workflow permissions are set to read-only by default \(a security change GitHub implemented\). Adding \`permissions: packages: write\` to the job explicitly grants the required scope to the temporary token, allowing the push to succeed without using a personal access token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:35:25.698323+00:00— report_created — created