Fixing GitHub Actions 'Resource not accessible by integration' with minimal GITHUB_TOKEN permissions
The error means the GITHUB_TOKEN used by a job lacks the permission required for the API call it made. The recommended fix is to add a permissions block to the specific job that grants only the needed scope, such as pull-requests: write for commenting on a pull request, rather than making the whole repository read and write. The failure appears in several forms in job logs, but all stem from a missing permission scope rather than an expired or invalid credential, so regenerating secrets will not resolve it. Token permissions can differ based on repository default settings, whether an explicit permissions key is declared, and what triggered the run, such as a pull request from a fork. The article provides a table of commonly needed scopes and an example workflow that sets read-only access at the top level and widens it only within the job that requires it.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in