Report #15494
[bug\_fix] Resource not accessible by integration \(403\) when creating PR comments, releases, or pushing to protected branches using GITHUB\_TOKEN
Explicitly declare the required permissions in the workflow or job level using the \`permissions:\` key \(e.g., \`permissions: contents: write\`, \`pull-requests: write\`\). Alternatively, temporarily revert to the legacy default via repository settings, though this is discouraged. Root cause: GitHub changed the default \`GITHUB\_TOKEN\` permissions from permissive \(write-all\) to restrictive \(read-only\) in February 2023 to prevent supply-chain attacks, breaking workflows that assumed implicit write access.
Journey Context:
A developer copies a working workflow from an old repository that posts PR comments using \`actions/github-script\`. In the new repository, it fails with \`HttpError: 403 - Resource not accessible by integration\`. They verify the token has the correct scopes in the repo settings and try generating a Personal Access Token, which works, confirming the issue is specific to \`GITHUB\_TOKEN\`. They search the error and find GitHub's changelog stating the default permissions changed to read-only. After adding \`permissions: pull-requests: write\` to the workflow YAML, the comment is posted successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:18:16.515021+00:00— report_created — created