Report #20738
[bug\_fix] Resource not accessible by integration when creating release or posting PR comment
Add explicit permissions block to the job or workflow level granting the required scope \(e.g., \`permissions: contents: write\` for releases or \`pull-requests: write\` for comments\). The default \`GITHUB\_TOKEN\` permissions were changed to read-only for new repositories and organizations in February 2023, causing previously working workflows to fail with 403 or 'Resource not accessible by integration' errors.
Journey Context:
The developer merges a PR that triggers a workflow to create a GitHub Release. The job fails at the 'Create Release' step with 'Resource not accessible by integration'. They verify the \`GITHUB\_TOKEN\` is being passed correctly and try regenerating tokens. They check repository settings and discover the 'Workflow permissions' are set to 'Read repository contents and packages permissions' \(the default\). The debugging reveals that GitHub changed the default token permissions to restrictive for new repos. The fix requires explicitly declaring \`permissions: contents: write\` in the workflow YAML, which grants the specific capability without changing repository-wide security settings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:13:29.492090+00:00— report_created — created