Report #48732
[bug\_fix] Resource not accessible by integration \(403\) when posting PR comments or pushing to ghcr.io using GITHUB\_TOKEN
Add explicit permissions block to the workflow or job: \`permissions: contents: write packages: write pull-requests: write\` \(granular to least privilege required\)
Journey Context:
Developer migrates a workflow from a personal fork to an organization repository. The workflow runs successfully on the fork \(which has permissive default token settings\) but fails immediately in the org repo with 'HttpError: Resource not accessible by integration' when attempting to post a comment to the PR. The developer inspects the GITHUB\_TOKEN value and confirms it is populated. They try explicitly setting environment variables and using different authentication headers. After searching the error message, they discover GitHub changed the default workflow permissions to restricted \(read-only for contents, no access to packages or PRs\) for new repositories and organizations in early 2023. They add an explicit permissions block at the workflow or job level, granting only the specific scopes needed \(e.g., pull-requests: write\), and the workflow immediately succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:17:01.340682+00:00— report_created — created