# 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.

By Grant Unwin, published 2026-11-16. Checked against GitHub's documentation on 2026-11-16. The web page: https://www.runners.io/blog/github-actions-resource-not-accessible-by-integration

“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](https://www.runners.io/blog/github-actions-limits) 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.

```yaml
- 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 this | Give the job | Permission |
| --- | --- | --- |
| Add a comment to an issue | issues: write | issues |
| Add a label to a pull request | pull-requests: write | pull-requests |
| Create a release | contents: write | contents |
| Cancel a workflow run | actions: write | actions |
| Create a check run | checks: write | checks |
| Create a deployment | deployments: write | deployments |
| Update a code scanning alert | security-events: write | security-events |
| Publish a package | packages: write | packages |
| Fetch an OpenID Connect token | id-token: write | id-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.

```yaml
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](https://www.runners.io/blog/github-actions-security-hardening) 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](https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target) 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](https://www.runners.io/docs/help/troubleshooting) lists the messages a job page shows, the [runner security page](https://www.runners.io/docs/runners/security) says what a job’s machine can reach, and the [pricing page](https://www.runners.io/pricing) has the rate for the minutes a failed run still uses.

## Sources

- [Troubleshooting the REST API](https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api)
- [GITHUB\_TOKEN](https://docs.github.com/en/actions/concepts/security/github_token)
- [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax)
- [gh api (GitHub CLI manual)](https://cli.github.com/manual/gh_api)
- [actions/checkout](https://github.com/actions/checkout)
- [pull\_request\_target blocked by default December 2 (GitHub changelog, 2 November 2026)](https://github.blog/changelog/2026-11-02-pull_request_target-blocked-by-default-december-2)
- [Troubleshooting Dependabot on GitHub Actions](https://docs.github.com/en/code-security/dependabot/troubleshooting-dependabot/troubleshooting-dependabot-on-github-actions)
- [Error: 403 "Resource not accessible by integration" (code scanning)](https://docs.github.com/en/code-security/reference/code-scanning/troubleshoot-analysis-errors/resource-not-accessible)
- [Managing GitHub Actions settings for a repository](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository)

## 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.
