Report #14370
[bug\_fix] Resource not accessible by integration \(403\) when attempting git push, creating releases, or commenting on PRs using GITHUB\_TOKEN
Add an explicit \`permissions\` block at the workflow or job level granting required scopes \(e.g., \`permissions: contents: write, pull-requests: write\`\). The default GITHUB\_TOKEN permissions changed to restrictive read-only for new repositories and organizations; workflows must explicitly declare elevated permissions rather than relying on legacy broad defaults.
Journey Context:
You set up a workflow to automatically create a GitHub Release when a tag is pushed. The job runs \`gh release create\` but fails with 'Resource not accessible by integration'. You check the repository settings and confirm the workflow has a GITHUB\_TOKEN defined. You try using a Personal Access Token \(PAT\) stored as a secret and the step succeeds, proving the issue is permission-scoping rather than authentication. Digging into the organization settings, you discover 'Workflow permissions' are set to 'Read repository contents and packages permissions' \(the secure default\). You realize the GITHUB\_TOKEN is scoped down by default. Instead of using a PAT \(which has broad access and poses a security risk\), you add \`permissions: contents: write\` to the job definition. The workflow now succeeds because the token is explicitly granted write access to contents for that specific job scope.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:20:52.922685+00:00— report_created — created