Report #98726
[bug\_fix] GitHub Actions job fails with 'Resource not accessible by integration' or 403 when GITHUB\_TOKEN tries to push a commit, create a pull request, publish a package, or post a PR comment.
Add an explicit permissions block to the job or workflow. For example, set \`permissions: contents: write\` for pushes, \`pull-requests: write\` for comments/reviews, or \`packages: write\` for GHCR. Keep the scope as narrow as possible instead of using \`permissions: write-all\`.
Journey Context:
You copy a workflow from an older repository or a blog post, and everything looks fine until the job that should open a release PR or push a changelog commit suddenly dies with a 403. You first suspect the token itself, so you print \`github.token\` \(masked\) and confirm it exists. You check repository settings and see the token is being issued, but the API call still fails. After searching the exact error message you land on a GitHub changelog noting that, starting February 2023, new repositories and workflows use restricted default permissions for \`GITHUB\_TOKEN\`. The token your job receives is read-only by default. Once you add \`permissions: contents: write\` to the job, the push succeeds. The lesson is that \`GITHUB\_TOKEN\` is not a static super-token; its effective scopes are determined by the \`permissions\` declaration in the workflow file.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:40:52.214743+00:00— report_created — created