GitHub Actions: "Resource not accessible by integration"
The token the step used, usually the job's GITHUB_TOKEN, does not have the permission that one API call needs, so GitHub answered 403. The fix is usually one line under permissions:. Which line depends on the call, and on what started the run.
What it looks like
From a public run on November 1, 2026, where actions/configure-pages failed:
##[error]Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the `enablement` parameter for this action. Error: Resource not accessible by integration - https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site
The same refusal as other tools print it:
GraphQL: Resource not accessible by integration (removeLabelsFromLabelable) gh: Resource not accessible by integration (HTTP 403) RequestError [HttpError]: Resource not accessible by integration
- "Integration" means a GitHub App.
GITHUB_TOKENis an installation token of the GitHub Actions app, and it can reach only the repository the workflow runs in. A fine-grained personal access token that lacks a permission gets "Resource not accessible by personal access token" instead (which permission that token lacks). - The job runs normally up to that call. The build and the tests before it may have passed.
Finding the permission it needed
- Open the failed job, expand Set up job, then GITHUB_TOKEN Permissions. It lists what the token had. In the Pages run above it had only:
GITHUB_TOKEN Permissions Contents: read Metadata: read
- The 403 response carries an
X-Accepted-GitHub-Permissionsheader that names what the endpoint accepts. Commas join permissions needed together (pull_requests=write,contents=read), and a semicolon separates alternatives.actions/github-scriptprints the response headers with the error; one scheduled workflow that created an issue showed'issues=write'(memphis #638). Withgh,-iprints the headers even when the call fails:gh api -i "repos/$GITHUB_REPOSITORY/pages"
- The header uses API names with an underscore. In the workflow they are written with a hyphen:
pull_requests=writeispull-requests: write.
Why the permission was missing
- A
permissionsblock left it out. From GitHub's workflow syntax reference: "If you specify the access for any of these permissions, all of those that are not specified are set tonone." So addingpermissions: contents: readto a workflow takes away every write the job had before. A Lock Threads workflow grantedissues: writeandpull-requests: write, but its action also processes closed discussions and the repository has Discussions, so every run failed untildiscussions: writewas added (DynamicData #1212). A reusable workflow can keep or reduce the caller's permissions but never raise them, so the line belongs in the calling job (llm-d-kv-cache #743). - The default is read only. Under Settings, Actions, General, "Workflow permissions" is either read and write for all permissions (permissive) or read only for
contentsandpackages(restricted), and organization owners can restrict it further. With the restricted default and nopermissionsblock, every write fails. A release-drafter workflow failed this way and neededcontents: writeandpull-requests: read(docker-buildkite-plugin #322). - The run got a read-only token whatever the workflow says:
- A
pull_requestfrom a fork gets a read-onlyGITHUB_TOKENand no secrets. A private repository can turn on "Send write tokens to workflows from pull requests"; a public one cannot. One project's benchmark comment was refused on every pull request from a fork and posted on pull requests from its own branches; it now comments only when the head repository is its own and leaves the table in the job summary for forks (optbench #38):- name: Comment on the pull request if: github.event.pull_request.head.repo.full_name == github.repository
pull_request_targetdoes get a write token from public forks, and GitHub warns against checking out the fork's code in it. - Runs started by Dependabot from
push,pull_request,pull_request_revieworpull_request_review_commentare treated like forks: a read-only token and no Actions secrets. Unlike forks, thepermissionskey can raise the token for them.
- A
The permission for common tasks
- Add or remove a label on a pull request:
pull-requests: write. The labels endpoint is shared with issues, so the header can readissues=write; pull_requests=write, yet two public reports showissues: writealone refused on a pull request (llm-d-kv-cache #743, StellarCred #955). - Create an issue, or comment on one:
issues: write. Comment on a pull request:pull-requests: write. - Create or update a release, push a commit or a tag:
contents: write. - Lock or close discussions:
discussions: write. - GitHub Pages:
pages: readforactions/configure-pages;pages: writeandid-token: writeforactions/deploy-pages. - Upload a SARIF file to code scanning:
security-events: write, plusactions: readandcontents: readin a private repository. - Create a check run:
checks: write. Set a commit status:statuses: write. - Publish to GitHub Packages:
packages: write. Get an OIDC token to sign in to a cloud:id-token: write. Cancel a workflow run:actions: write.
Grant it on the job that makes the call, and repeat the reads that job still needs, since everything not listed becomes none:
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
What no permission fixes
- Another repository.
GITHUB_TOKENreaches only the workflow's own repository; for another one, use a GitHub App token or a fine-grained personal access token stored as a secret. - Repository administration, such as reading branch protection. It is not among the permissions a workflow can grant.
- "GitHub Actions is not permitted to create or approve pull requests" is a different message: the setting "Allow GitHub Actions to create and approve pull requests", under the same "Workflow permissions", is off. New repositories in a personal account start with it off.
- A 403 "Must have admin rights to Repository." when downloading logs means the request carried no token at all, even for a public repository (logs and admin rights).
See failed jobs from IntelliJ IDEA
Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the runs of all your repositories in an IDE tool window, with their jobs and steps, so the step that was refused stands out, and your current branch's runs are in the status bar. Reading is free; re-running failed jobs, cancelling, running workflows and reviewing deployments are Pro (US$1.50 a month, with a 30-day trial).
GitHub and GitHub Actions are trademarks of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with, sponsored or endorsed by GitHub, Inc. or JetBrains.
More: "Unable to resolve action" · "The operation was canceled" · "Must have admin rights to Repository" · Re-running jobs with debug logging · GitHub Actions plugins for IntelliJ IDEA compared · 日本語