Report #61360
[bug\_fix] HttpError: Resource not accessible by integration \(403\) when creating release, PR comment, or artifact upload using GITHUB\_TOKEN
Add explicit permissions to the job or workflow: \`permissions: contents: write\` \(or \`pull-requests: write\`, \`issues: write\` as needed\) or \`permissions: write-all\`. The default token permissions were restricted to read-only for new repositories and fork PRs.
Journey Context:
A developer creates a workflow that posts a comment to a PR using \`actions/github-script\` and the built-in \`GITHUB\_TOKEN\`. It works on their branch, but when an external contributor opens a PR from a fork, the job fails with a 403 'Resource not accessible by integration'. The developer checks the repository settings and confirms 'Read and write permissions' is selected, but the error persists. After digging into GitHub documentation, they realize that for security, workflows triggered by \`pull\_request\` events from forks have a restricted \`GITHUB\_TOKEN\` that is read-only by default, regardless of repository settings. The developer adds \`permissions: pull-requests: write\` to the job definition, which explicitly grants the required scope, allowing the workflow to post comments on fork PRs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:28:47.600799+00:00— report_created — created