Report #4118
[bug\_fix] Workflow fails with 'Resource not accessible by integration' or 403 Forbidden when creating releases, posting PR comments, or pushing to protected branches despite using GITHUB\_TOKEN.
Add an explicit \`permissions:\` block at the workflow or job level granting specific write access \(e.g., \`permissions: contents: write\`, \`pull-requests: write\`\). The root cause is that GitHub changed the default \`GITHUB\_TOKEN\` permission to read-only for new repositories and organizations in February 2023; workflows assuming legacy write-by-default behavior now fail with 403 errors because the token lacks the required OAuth scopes.
Journey Context:
You migrate an old workflow to a new repository or your organization admin flips a security switch. Suddenly, a job that posts a comment on a PR or creates a GitHub Release fails with 'Resource not accessible by integration'. You check the token scopes in the job logs and see it only has \`read\` access. You try using a Personal Access Token \(PAT\) which works but violates security policy. Digging into the repository settings, you notice 'Workflow permissions' is set to 'Read repository contents'. The fix is explicit: you must declare \`permissions:\` in the YAML to override the restrictive default, granting only the specific write scopes required \(e.g., \`issues: write\`\), adhering to the principle of least privilege while restoring functionality.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:50:27.534210+00:00— report_created — created