Skip to content

Home / Blog / Runners and limits

Fix "Resource not accessible by integration" in GitHub Actions

"Resource not accessible by integration" means the job's token lacks a permission. How to find it, grant it, and handle fork and Dependabot runs.

“Resource not accessible by integration” means the token your job used lacks the permission the API call needs. The GITHUB_TOKEN in a workflow is a GitHub App token, and GitHub’s documentation says this error means such a token has insufficient permissions. Add a permissions block that grants the one permission the call needs. Fork and Dependabot pull requests get a read-only token whatever the block says, and from 2 December 2026 pull_request_target is blocked by default in public repositories.

In short
  • The message means the token lacks a permission the call needs; GITHUB_TOKEN is a GitHub App installation token.
  • GitHub's documentation points to the X-Accepted-GitHub-Permissions header for the permission an endpoint requires.
  • Add a permissions block to the job, and keep contents: read, because naming one permission sets the rest to none.
  • Pull requests from forks and Dependabot runs get a read-only token, whatever the workflow's block says.
  • From 2 December 2026 pull_request_target is blocked by default in public repositories unless a policy allows it.

This post covers what the message means, how to find the permission a call requires, how to grant it without giving the job more than it needs, and the four situations where a block that looks right still gets this error: a pull request from a fork, a Dependabot run, a restricted default that applies when there is no block, and a call to another repository. The documentation is GitHub’s, read on 15 November 2026.

What does “Resource not accessible by integration” mean?

At the start of each job GitHub creates a GITHUB_TOKEN for it. GitHub’s pages on the token describe it as a GitHub App installation access token, with permissions limited to the repository that holds the workflow, and the app is the one GitHub installs on a repository when Actions is enabled. So the token has the powers of an app with a short list of permissions, and an API call that needs a permission outside the list is refused. The message is the refusal, and GitHub’s page for the code scanning form of it titles it a 403.

GitHub’s page lists the same error for a fine-grained personal access token, worded “Resource not accessible by personal access token”. The cause GitHub gives for both is insufficient permissions, which is a different thing from a missing repository, a wrong name or a rate limit. A rate limit returns a different message, which the limits post lists.

How do I find the permission a call needs?

GitHub’s documentation names a way to find out. It points to an X-Accepted-GitHub-Permissions header, described for GitHub App and fine-grained token requests, whose value is the permissions the endpoint needs: a comma-separated list when it needs several, with alternatives separated by a semicolon. A value of contents=read means read access to contents. A value of pull_requests=write,contents=read means write access to pull requests and read access to contents. We could not confirm that every response carries it, so if the header is missing, the endpoint’s page in the REST reference lists the permissions it needs.

- name: Which permission does this call need?
  if: failure()
  env:
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    gh api -i "repos/${{ github.repository }}/issues/1/comments" \
      | grep -i 'x-accepted-github-permissions\|^HTTP'

The -i flag of gh api includes the status line and headers in the output, so the grep prints the status and the header, if there is one. The sample reads comments, so it shows the permission for reading them; replace the path with a read of the same resource your failing step writes to. Where the failing call is inside an action, the action’s own documentation lists the permissions it needs, and the table below is the short list for the calls that fail most often.

To do thisGive the jobPermission
Add a comment to an issueissues: writeissues
Add a label to a pull requestpull-requests: writepull-requests
Create a releasecontents: writecontents
Cancel a workflow runactions: writeactions
Create a check runchecks: writechecks
Create a deploymentdeployments: writedeployments
Update a code scanning alertsecurity-events: writesecurity-events
Publish a packagepackages: writepackages
Fetch an OpenID Connect tokenid-token: writeid-token

How do I grant it without granting too much?

Put the block on the job that needs it, not at the top of the file. A permissions key at the top applies to every job, and one inside a job applies to that job’s actions and commands only. Name each permission and its level, read, write or none, where write includes read.

jobs:
  label:
    runs-on: ubuntu-latest
    permissions:
      contents: read        # checkout still needs this
      pull-requests: write  # add the label
    steps:
      - uses: actions/checkout@v7
      - run: gh pr edit "$PR" --add-label reviewed
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PR: ${{ github.event.pull_request.number }}

There is a trap in the first line of that block. GitHub says that when you specify any permission, every one you do not specify is set to none. A job that adds only issues: write to fix one error has just taken away read access to the repository’s contents, which a checkout step reads with the token. The checkout action’s README recommends contents: read unless other authentication is given, so list it beside the new permission. The security hardening post explains why the narrow block is also the safer one.

Why does it work on a branch but fail on a pull request from a fork?

Because GitHub changes the token after your block is applied. For a pull request from a fork, any write permission is changed to read-only, unless an administrator has chosen “Send write tokens to workflows from pull requests” in the repository’s Actions settings, an option GitHub’s settings page lists for private repositories. A permissions key can add and remove read permissions for a fork, but typically cannot grant write. So a workflow that comments or labels on a pull request works for people with write access and fails for outside contributors, with this message.

One common suggestion is to trigger on pull_request_target, which GitHub’s Dependabot page lists as an option and its workflow syntax reference documents as giving the token read and write permission even from a public fork. It also runs in the context of the base repository with access to its secrets, which is why it is dangerous when the workflow runs code from the pull request. On 2 November 2026 GitHub announced that from 2 December 2026 it blocks pull_request_target events by default in public repositories, unless an Actions event policy allows them, with two scheduled brownouts, on 9 and 16 November, in which blocked attempts create failed runs. Private and internal repositories are not affected. GitHub’s page on using pull_request_target securely says how to use it without running code from the pull request.

Why do Dependabot pull requests get it?

By default, GitHub treats workflow runs that Dependabot triggers from push, pull request, review and review comment events as if they came from a fork. They get a read-only GITHUB_TOKEN and no secrets but Dependabot’s own, so any workflow that writes to the repository fails when Dependabot starts it. GitHub’s page lists three ways out: skip the workflow for Dependabot with an if: github.actor != 'dependabot[bot]' condition, do the write in a pull_request_target workflow, or raise the token’s scope with a permissions key.

Code scanning is the common case. GitHub’s page for this exact error says that uploading results for a branch usually needs security-events: write, but that code scanning always allows an upload when a pull_request event triggers the run, which is why it recommends the pull_request event for Dependabot branches instead of push. It also warns that a squash-and-merge of a Dependabot pull request produces a commit authored by Dependabot, so the workflows that run on it have read-only permissions too.

What if the repository’s default is restricted?

A workflow with no permissions key gets the default for the repository, which is set at the enterprise, organization or repository. GitHub says a new repository in a personal account starts with read access to contents and packages only, and one in an organization inherits the organization’s setting. So a workflow that worked in one repository and not in another may simply have a different default. Look under Settings, Actions, General, Workflow permissions. Creating or approving a pull request has its own switch there, “Allow GitHub Actions to create and approve pull requests”, and a token without it cannot do either, whatever the block says.

What if the call is to another repository?

The token’s permissions are limited to the repository that contains the workflow, so a call that writes to a different repository is outside what the token can do, whatever permissions the block lists. Use a GitHub App installation token or a personal access token for that call, store it as a secret, and keep the GITHUB_TOKEN for the repository the workflow is in.

Is it different on runners.io?

No. The token is GitHub’s, issued to the job whichever runner it lands on, and its permissions are decided by the workflow, the repository settings and the event, as above. Nothing about our runners adds or removes one. If a job on our runners fails for a reason this post does not cover, the troubleshooting page lists the messages a job page shows, the runner security page says what a job’s machine can reach, and the pricing page has the rate for the minutes a failed run still uses.

Sources

Frequently asked questions

What does "Resource not accessible by integration" mean in GitHub Actions?

The token the job used does not have the permission the API call needs. GitHub says a GitHub App or fine-grained token that gets this error has insufficient permissions, and the GITHUB_TOKEN in a workflow is a GitHub App installation token.

How do I find which permission a GitHub API call needs?

GitHub's documentation points to the X-Accepted-GitHub-Permissions header. It lists the permissions the endpoint requires, comma-separated, with alternative sets separated by a semicolon. The gh api command with the -i flag prints response headers.

Why does it fail on a pull request from a fork?

GitHub changes any write permission to read-only for a pull request from a fork, unless an administrator chose to send write tokens to workflows from pull requests, an option it lists for private repositories. A permissions key typically cannot grant write.

Why does Dependabot get this error?

By default, runs that Dependabot triggers from push and pull request events are treated like fork runs. They get a read-only GITHUB_TOKEN and no secrets except Dependabot's, so a workflow that writes to the repository fails until you change it.

Move your CI onto our runners with one line

Connect GitHub

Card required. You pay only for the minutes your jobs run.

.github/workflows/ci.yml
jobs: test:- runs-on: ubuntu-latest+ runs-on: runnersio-4vcpu-ubuntu-2404 steps: - uses: actions/checkout@v4 - run: make test+ build:+ runs-on: runnersio-32vcpu-ubuntu-2404