Report #36206
[bug\_fix] HttpError: Resource not accessible by integration \(403\) when attempting to post PR comment, create release, or push to repository using GITHUB\_TOKEN
Explicitly declare the required permissions in the workflow YAML using the \`permissions\` key \(e.g., \`permissions: pull-requests: write\` or \`permissions: contents: write\`\). This elevates the default read-only GITHUB\_TOKEN for that specific job without needing a Personal Access Token.
Journey Context:
Developer creates a workflow that uses \`actions/github-script\` to post a comment on a pull request. It works on their personal repository, but when pushed to an organization repository, it fails with a 403 'Resource not accessible by integration' error. Checking the job logs, the 'Set up job' step shows 'Token: \*\*\*' with a 'Permissions' section listing only 'Metadata: read' and 'Contents: read'. The developer realizes the organization has set 'Workflow permissions' to 'Read repository contents and packages' by default. Instead of generating a PAT \(which would have excessive permissions and security risks\), they discover they can add a \`permissions: pull-requests: write\` block to the job. On the next run, the logs show 'Permissions: pull-requests: write', and the comment posts successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:15:11.525884+00:00— report_created — created