Release Please cannot create pull request with configured workflow permissions
Code of Conduct
- I agree to follow the Code of Conduct
Existing issues
- I searched existing issues and this hasn't been reported yet
What happened?
The Release Please workflow failed while creating the release pull request in run https://github.com/career-ops-hq/career-ops/actions/runs/35302765717/job/105468674798. Release Please successfully created the release tree and commit, and updated release-please--branches--main, but GitHub rejected the pull request creation with: GitHub Actions is not permitted to create or approve pull requests. The workflow requests contents: write, pull-requests: write, and id-token: write, so the repository or organization-level Actions policy appears to disallow the GITHUB_TOKEN from creating pull requests.
Steps to reproduce
- Push a change to
mainthat causes Release Please to prepare a release. - Run the
Release Pleaseworkflow. - Observe the action successfully create/update the release branch and commit.
- Observe the action fail when it attempts to create the release pull request.
Failed run: https://github.com/career-ops-hq/career-ops/actions/runs/35302765717/job/105468674798
Expected behavior
Release Please should be able to create the release pull request after preparing the release commit, or the workflow should use an explicitly configured GitHub App/PAT token with permission to create pull requests.
CLI tool
GitHub Actions / Release Please
OS and Node.js version
GitHub-hosted runner (ubuntu-latest); repository workflow permissions include contents: write, pull-requests: write, and id-token: write
Output of npm run doctor
Release Please job log excerpt:
✔ Successfully created a tree with the desired changes with SHA e4ffc48d5b53ff711ae5771b84532a7eeb6263e5
✔ Successfully created commit. See commit at https://api.github.com/repos/career-ops-hq/career-ops/git/commits/f42fb09c6de6e4574e7378e7e16d34424039a07e
✔ Updating reference heads/release-please--branches--main to f42fb09c6de6e4574e7378e7e16d34424039a07e
✔ Successfully updated reference release-please--branches--main to f42fb09c6de6e4574e7378e7e16d34424039a07e
##[error]release-please failed: GitHub Actions is not permitted to create or approve pull requests. - https://docs.github.com/rest/pulls/pulls#create-a-pull-request
The job also reports repeated commit parsing warnings for merge commits, but it continues processing and successfully creates the release commit. These warnings do not appear to be the fatal failure.Source: santifer/career-ops