release-please failed: Error creating Pull Request


Problem

This post goes over how to fix the GitHub Actions error:

release-please failed: Error creating Pull Request: Resource not accessible by integration

Or:

Error: release-please failed: GitHub Actions is not permitted to create or approve pull requests.

Solution

The root cause is that GitHub’s default repository workflow permissions changed from write to read in 2022.

The fix is to go to repository Settings > Code and automation > Actions > General > Workflow permissions and check:

  • Read and write permissions
  • Allow GitHub Actions to create and approve pull requests

GitHub Actions Workflow Permissions

You may also need to update your workflow permissions .github/workflow/release-please.yml:

permissions:
  contents: write
  pull-requests: write

See issue for more information.



Please support this site and join our Discord!