Report #9432
[bug\_fix] Resource not accessible by integration \(403\) when posting PR comments or creating releases using GITHUB\_TOKEN
Add explicit permissions to the job or workflow YAML \(e.g., \`permissions: pull-requests: write\` or \`contents: write\`\). The default GITHUB\_TOKEN was restricted to read-only for new repositories and organizations after GitHub's February 2023 security update, requiring explicit opt-in for write operations.
Journey Context:
A developer merges a workflow that uses \`actions/github-script\` to post a comment on a PR. It works perfectly on their feature branch push, but fails on pull requests with a 403 'Resource not accessible by integration'. They suspect a bug in the action and try switching to the \`gh\` CLI, encountering the same error. They check the repository settings under Actions > General and notice 'Workflow permissions' is set to 'Read repository contents and packages permissions'. They realize that GitHub changed the default token permissions in early 2023 to prevent pwn requests. Instead of changing the global setting \(which affects all workflows\), they add \`permissions: pull-requests: write\` to the specific job, granting least privilege and fixing the 403.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:12:23.313177+00:00— report_created — created