Resource not accessible by integration: the token lacks a permission
Resource not accessible by integration
A workflow step called the GitHub API with a GITHUB_TOKEN or GitHub App token that doesn't hold the permission the endpoint needs, so GitHub refused the request.
From GitHub's documentation, checked 22 Nov 2026.
Resource not accessible by integrationAlso searched as: HttpError: Resource not accessible by integration · 403 Resource not accessible by integration · Resource not accessible by personal access token · GITHUB_TOKEN resource not accessible by integration · github actions 403 resource not accessible
What it means
GitHub's REST API troubleshooting page says that when a GitHub App or fine-grained personal access token gets "Resource not accessible by integration" (or "Resource not accessible by personal access token"), the token has insufficient permissions. In a workflow it usually means the job's GITHUB_TOKEN wasn't given the scope the call needs, such as write access to issues or pull requests, because GitHub sets that token's permissions from the repository default and the workflow's permissions key.
Common causes
- The workflow or job doesn't grant the scope the call needs. Once a permissions key names any scope, every scope it doesn't name is set to none.
- The repository or organization default for the GITHUB_TOKEN is the restricted setting, which gives read access to contents and packages only, and the workflow doesn't ask for more.
- The run was triggered by Dependabot, or by a pull request from a fork, and was given a read-only GITHUB_TOKEN.
- The call reaches a resource outside the repository the workflow runs in, which the GITHUB_TOKEN can't reach.
From GitHub's documentation
How to fix it
Ask the API which permission the endpoint needs
GitHub's REST API returns an X-Accepted-GitHub-Permissions header listing the permissions a GitHub App or fine-grained token needs for that endpoint, for example pull_requests=write,contents=read. Semicolons separate alternative sets. Call the endpoint that failed and read the header.
curl -s -o /dev/null -D - -H "Authorization: Bearer <token>" https://api.github.com/repos/<owner>/<repo>/<endpoint> | grep -i x-accepted-github-permissions
Grant that scope with the permissions key
Set permissions for the whole workflow at the top level, or for one job. Any scope you leave out is set to none, so list everything the job uses, and grant the least access that works. Anyone with write access to the repository can change these by editing the workflow file.
permissions: contents: read issues: write pull-requests: write
Check the repository default and how the run was triggered
In the repository, open Settings, then Actions, then General, and look at Workflow permissions: the restricted setting gives read access to contents and packages only. If the organization chose the restricted default, the permissive option is disabled at repository level, and the permissions key is the way to grant more. Runs triggered by Dependabot get a read-only token; GitHub documents skipping them with if: github.actor != 'dependabot[bot]', or raising the scope with the permissions key. For resources in another repository, GitHub says to use a GitHub App installation token or a personal access token instead.
How to confirm it's fixed
- The header from the first check lists only permissions the job's permissions key now grants.
- The workflow re-runs and the step that called the API finishes without the error.
- For Dependabot runs, a new Dependabot-triggered run (not a manual re-run, which keeps the original privileges) completes the write.
Related notes
GitHub documents that re-running a Dependabot-triggered workflow by hand runs it with the same privileges as before, so a re-run alone won't show whether a permissions change worked. Workflows triggered by pull_request_target get a read and write GITHUB_TOKEN even when it is triggered from a public fork.
Related engineering templates
Continue the investigation
Follow GitHub Actions failures and fixes
A short email about twice a week with new runbooks, configuration traps and fixes from KBY Technologies.