peter-evans/create-pull-request "GitHub Actions is not permitted to create or approve pull requests"
A repo or org setting controls whether GITHUB_TOKEN can open PRs. When it is off, create-pull-request fails even with pull-requests: write granted.
What this error means
create-pull-request fails with "GitHub Actions is not permitted to create or approve pull requests".
github-actions
Error: GitHub Actions is not permitted to create or approve pull requests.
##[error]GitHub Actions is not permitted to create or approve pull requests.Common causes
Org/repo toggle disabled
Settings > Actions > "Allow GitHub Actions to create and approve pull requests" is off.
Workflow missing pull-requests: write
Even with the toggle on, the token needs pull-requests: write to open a PR.
How to fix it
Enable the toggle and grant the scope
- In Settings > Actions > General, enable "Allow GitHub Actions to create and approve pull requests".
- Add pull-requests: write and contents: write to the workflow permissions.
- Re-run; the PR is created.
.github/workflows/auto-pr.yml
permissions:
contents: write
pull-requests: write
steps:
- uses: peter-evans/create-pull-request@v6
with:
branch: automated/update
title: Automated updateHow to prevent it
- Set the org-level Actions PR toggle once for all repos that automate PRs.
- Use a dedicated app or PAT when PRs must trigger downstream workflows.
Frequently asked questions
What causes ""not permitted to create or approve pull requests""?
Settings > Actions > "Allow GitHub Actions to create and approve pull requests" is off.
How do I fix "not permitted to create or approve pull requests"?
Enable the toggle and grant the scope
Related guides
ad-m/github-push-action "remote rejected" on a protected branchFix ad-m/github-push-action "remote rejected" caused by branch protection rules blocking the push.
GitHub Actions GITHUB_TOKEN cannot trigger another workflowFix the GitHub Actions behavior where events created with the default GITHUB_TOKEN do not trigger further wor…
stefanzweifel/git-auto-commit "nothing to commit, working tree clean"Understand stefanzweifel/git-auto-commit reporting "nothing to commit" when no files changed in the working t…