Report #65247
[bug\_fix] Resource not accessible by integration \(403\) when creating release or commenting on PR using GITHUB\_TOKEN
Add explicit \`permissions\` block at workflow or job level \(e.g., \`permissions: contents: write\` for releases, or \`pull-requests: write\` for PR comments\) because the default \`GITHUB\_TOKEN\` permissions changed to restrictive \(read-only\) for new repositories and organizations in February 2023.
Journey Context:
Developer sets up a workflow to auto-create a GitHub Release when a tag is pushed. It works perfectly on their main branch, but fails on Pull Requests from forks with a 403 "Resource not accessible by integration" error. They verify the token exists by printing \`env.GITHUB\_TOKEN\` \(masked\), ruling out absence. They try adding \`permissions: write-all\` at the top level, but still fail on PRs. Checking the workflow run logs under "Set up job", they notice "Token permissions: read" despite the workflow-level setting. Eventually they discover that for \`pull\_request\` events from forks, the workflow runs in the fork's context with read-only tokens for security, OR that their organization had enabled restrictive defaults. They learn that explicit \`permissions:\` declarations are required to override the new default read-only setting for the repository.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:00:06.906258+00:00— report_created — created