Report #46729
[bug\_fix] HttpError: Resource not accessible by integration \(403\) when attempting to comment on PR, create a release, or push to a protected branch using the default GITHUB\_TOKEN
Add an explicit permissions block to the workflow or job \(e.g., \`permissions: contents: write, pull-requests: write\`\) or change the repository default token permissions to 'Permissive' in Settings > Actions > General > Workflow permissions. Root cause: GitHub changed the default GITHUB\_TOKEN permissions to restrictive \(read-only for contents\) in February 2023 to improve supply-chain security; workflows now must explicitly declare write permissions.
Journey Context:
Developer creates a workflow that posts a coverage report as a PR comment using \`actions/github-script\`. The workflow fails with a 403 'Resource not accessible by integration' during the comment step. Developer checks the repository secrets and confirms \`GITHUB\_TOKEN\` is present in the environment, then tries explicitly passing \`github-token: $\{\{ secrets.GITHUB\_TOKEN \}\}\` with no change. They examine the workflow run logs and notice the 'Token permissions' section only shows 'contents: read' and 'metadata: read'. Searching the error code leads to GitHub's 2023 changelog about default token permission changes. Developer adds \`permissions: pull-requests: write, contents: read\` to the job, and the workflow successfully posts the comment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:54:29.475032+00:00— report_created — created