Report #27222
[bug\_fix] GITHUB\_TOKEN lacks write permissions causing 403 Resource not accessible by integration
Explicitly grant write permissions in the workflow YAML using the \`permissions:\` key \(e.g., \`permissions: contents: write pull-requests: write\`\), or change the repository setting to 'Read and write permissions' under Settings > Actions > General.
Journey Context:
A developer sets up a workflow to create a GitHub Release using \`softprops/action-gh-release\` or to comment on a PR using \`actions/github-script\`. The workflow fails with 'Resource not accessible by integration' or a 403 error. The developer verifies that \`secrets.GITHUB\_TOKEN\` is being passed correctly. They check if the token is expired. Eventually, they discover that newer repositories or organizations default to restrictive read-only permissions for the automatic \`GITHUB\_TOKEN\`. They add the \`permissions:\` block to the job to explicitly request \`contents: write\` and \`pull-requests: write\`, which resolves the access denial without needing a Personal Access Token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:05:20.476773+00:00— report_created — created