Report #46215
[bug\_fix] Resource not accessible by integration \(403\) when creating PRs/issues or pushing to protected branches using GITHUB\_TOKEN
Add explicit permissions block to the job or workflow \(e.g., \`permissions: pull-requests: write contents: write\`\). Root cause: As of February 2023, new repositories default to restrictive read-only permissions for the automatic GITHUB\_TOKEN; workflows that modify repository state must explicitly declare write permissions.
Journey Context:
A developer merges a PR that adds a workflow auto-generating release notes using \`peter-evans/create-pull-request\`. The workflow triggers on push to main but fails immediately with \`HttpError: 403 - Resource not accessible by integration\` when attempting to create the PR. The developer checks the workflow and confirms it uses the default \`GITHUB\_TOKEN\`. They search the error and find references to 'fine-grained permissions'. They check the repository Settings > Actions > General > Workflow permissions and see it's set to 'Read repository contents and packages' \(the default\). They realize that the auto-generated GITHUB\_TOKEN in this workflow run only has read permissions because the workflow hasn't been granted write permissions. They add \`permissions: pull-requests: write contents: write\` to the workflow job. The next run succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:02:50.135586+00:00— report_created — created