# How do I fix "refusing to allow an OAuth App to create or update workflow"?

"refusing to allow an OAuth App to create or update workflow" and its Personal Access Token and GitHub App wordings mean the token may not change workflow files.

By Grant Unwin, published 2026-11-20. Checked against GitHub's documentation on 2026-11-20. The web page: https://www.runners.io/blog/github-actions-refusing-to-allow-oauth-app-workflow-scope

“refusing to allow an OAuth App to create or update workflow \`.github/workflows/ci.yml\` without \`workflow\` scope” means your push changes a workflow file and the token behind it may not. There are 3 wordings, one per kind of token: “an OAuth App” (the GitHub CLI or a credential manager), “a Personal Access Token” (a classic token, also “without \`workflow\` scope”) and “a GitHub App ... without \`workflows\` permission”, which is what a job’s own `GITHUB_TOKEN` is. Push with a token that has the scope or the permission.

**In short**

- The push changes a file under .github/workflows and the token behind it is not allowed to.
- The OAuth App wording means an app's token without the workflow scope, such as the GitHub CLI's; the Personal Access Token wording, a classic token without it.
- The GitHub App wording is what a job's GITHUB\_TOKEN gets, and no permissions block can fix it.
- Pass checkout a token with the workflow scope, or an App token with the Workflows permission, and git push uses it.
- A workflow file whose path and contents match one on an existing branch needs no scope; any other is refused.

All three come back from GitHub as the reason a `git push` was rejected. Which one you see tells you what kind of token git used, and that decides the fix. This post takes them in turn, then the cases where the push touches a workflow file without your meaning it to.

## What does “refusing to allow an OAuth App to create or update workflow” mean?

GitHub guards the files under `.github/workflows` separately from the rest of the repository, and write access to the code is not enough to change one. Its scopes page gives a reason: workflow files can expose a `GITHUB_TOKEN` with a different set of scopes. A token with scopes, an OAuth app’s token or a classic personal access token, needs the `workflow` scope, which GitHub’s scopes page describes as granting the ability to add and update workflow files. A GitHub App’s token needs the repository permission GitHub calls Workflows. The message names the kind of token and whichever one is missing.

## How do I fix the OAuth App or Personal Access Token wording?

You see these wordings when you push from your own machine or from a tool, and the credential git used is a scoped token without `workflow`. Find out which credential that is, then widen it.

**The Personal Access Token wording: a classic personal access token.** Its full line is “refusing to allow a Personal Access Token to create or update workflow \`.github/workflows/ci.yml\` without \`workflow\` scope”. Create a new one with the `workflow` box ticked, and replace the old one wherever git reads it from: your credential manager, or the secret a script uses.

**The OAuth App wording: the GitHub CLI.** If git authenticates through `gh`, add the scope to the stored login. The command’s own help describes it as expanding the scopes of the stored credentials:

```bash
gh auth refresh --scopes workflow
```

**The OAuth App wording: an editor or another app.** The token belongs to that app’s sign-in, and only the app can ask GitHub for a wider one. If it offers no way to, push workflow changes with a personal access token or the GitHub CLI, as above.

## How do I fix the GitHub App wording in a workflow?

Inside a job, the default token is a GitHub App installation token, which is why a push from a workflow gets the GitHub App wording. It cannot be fixed with a `permissions` block. The list of permissions GitHub documents for `GITHUB_TOKEN` has no Workflows entry, and the marked answer in a GitHub Community discussion says so directly: `actions: write` does not let a job update workflow files, and you need a different token. In a second discussion, the reply saying the same has 31 thumbs-up, and the two replies recommending `actions: write` were voted down.

So give the job another token and make git use it. Checkout keeps the token it was given in git’s configuration for the later steps, so the token you pass to checkout is the one your `git push` uses:

```yaml
steps:
  - uses: actions/checkout@v4
    with:
      token: ${{ secrets.WORKFLOW_PUSH_TOKEN }}   # a PAT with workflow scope, or an App token with Workflows: write
  - run: ./update-workflows.sh
  - run: |
      git config user.name "github-actions[bot]"
      git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
      git add .github/workflows
      git commit -m "Update workflows"
      git push
```

The token can be a classic personal access token with the `workflow` scope, or a token minted in the job from your own GitHub App. For the App route, GitHub’s documentation says to request the Workflows repository permission when the app needs to edit files in `.github/workflows`, and commenters in the discussion add the step people miss: after you add the permission to the app, each installation has to accept the change before its tokens carry it.

## Why does it happen when I did not change a workflow?

Because the check is on what the push would add to the repository, not on what you meant to change. GitHub’s scopes page gives the rule in one sentence: a workflow file can be committed without the scope if the same file, with the same path and contents, already exists on another branch of the repository. A push is refused when it carries a workflow file whose path and contents do not match that file on any existing branch, even if the commit is already in the repository. Two ways that happens, from the reports:

A formatter or code generator in the job rewrote a file under `.github/workflows`, and `git add -A` picked it up; the commenter who found this excluded the directory from the formatter. A job pushes a tag on an older commit, one already on `main`, whose workflow files have since changed on every branch; one report shows such a tag refused. To see whether your branch adds workflow changes, list the workflow files that differ from `main` before pushing:

```bash
git fetch origin
git diff --name-only origin/main...HEAD -- .github/workflows
```

That compares with `main` only, so it misses the tag case. For a tag, compare the tagged commit’s `.github/workflows` with the latest commit of each branch.

## Which token should a workflow use to change workflows?

One kept as a secret and passed only to the job that pushes. The [security hardening post](https://www.runners.io/blog/github-actions-security-hardening) covers how to scope it, and the post on [“Resource not accessible by integration”](https://www.runners.io/blog/github-actions-resource-not-accessible-by-integration) covers the permissions the default token can be given. If the push fails before GitHub answers at all, see [“could not read Username”](https://www.runners.io/blog/github-actions-could-not-read-username-terminal-prompts-disabled), and the [checkout reference](https://www.runners.io/blog/actions-checkout-every-input-v4-to-v7) lists the `token` input with the others.

The refusal is GitHub’s answer to the token, so it is the same on any runner, ours included. Every size we run, with its memory, disk and rate a minute, is on our [managed GitHub Actions runners](https://www.runners.io/runners) page.

## Sources

- [Scopes for OAuth apps](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps)
- [Choosing permissions for a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app)
- [Error: refusing to allow a GitHub App to create or update workflow (GitHub Community discussion 35410)](https://github.com/orgs/community/discussions/35410)
- [gh auth refresh (GitHub CLI source)](https://github.com/cli/cli/blob/trunk/pkg/cmd/auth/refresh/refresh.go)
- [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax)
- [GITHUB\_TOKEN](https://docs.github.com/en/actions/concepts/security/github_token)
- [Control permissions does not allow adding workflow files (GitHub Community discussion 26583)](https://github.com/orgs/community/discussions/26583)
- [actions/checkout](https://github.com/actions/checkout)
- [Unable to push tag with GitHub Actions GITHUB\_TOKEN (GitHub Community discussion 151442)](https://github.com/orgs/community/discussions/151442)
- [job-sop-improve failure: cannot push fork sync — token missing workflow scope (openshift-online/rosa-agent issue 166)](https://github.com/openshift-online/rosa-agent/issues/166)

## Frequently asked questions

### How do I fix "refusing to allow an OAuth App to create or update workflow"?

Push with a token that may change workflow files. There are 3 wordings: the OAuth App one is an app's token, such as the GitHub CLI's, without the workflow scope; the Personal Access Token one is a classic token without it; and the GitHub App one, about the workflows permission, is what a job's GITHUB\_TOKEN gets.

### How do I fix the OAuth App or Personal Access Token wording?

Find the credential git used and widen it. For the Personal Access Token wording, create a classic token with the workflow scope. For the OAuth App wording from the GitHub CLI, run gh auth refresh --scopes workflow, which expands the scopes of the stored login.

### How do I fix the GitHub App wording in a workflow?

Not with a permissions block: GITHUB\_TOKEN has no Workflows permission, and actions: write is not enough. Pass checkout a personal access token with the workflow scope, or a token from your own GitHub App with the Workflows permission, and git push uses it.

### Why does it happen when I did not change a workflow?

The check is on what the push carries. A workflow file can be pushed without the scope only if the same path and contents exist on a branch, even if the commit is already in the repository. A formatter that rewrote a workflow, or a tag on an older commit whose workflows have since changed, is refused.
