googleapis / release-please-action

automated releases based on conventional commits
Apache License 2.0
1.56k stars 200 forks source link

Non-default Branch - Error creating Pull Request: Reference update failed #997

Open tysonnero-ccm opened 2 months ago

tysonnero-ccm commented 2 months ago

Environment details

Steps to reproduce

  1. Create a repo with two branches main and release.
  2. Set release as the default branch.
  3. Create a release workflow similar like

     name: Release
    
     on:
       push:
         branches:
           - main
    
     permissions:
       contents: write
       pull-requests: write
    
     jobs:
       release:
         name: 'Release'
         runs-on: ubuntu-latest
         steps:
           - uses: google-github-actions/release-please-action@v4
             with:
               token: ${{ secrets.GITHUB_TOKEN }}
               release-type: node
               target-branch: main
  4. Create a branch off of release, make a change, push a commit, and merge a PR into release.
  5. Create a PR and merge into main.
  6. Navigate to the Actions tab and open the workflow run for the release.
  7. Click on the Release job and expand the relevant step.

Expected Results

When looking at the logs, you should see Successfully created branch at and the workflow should have successfully run

Actual Results

The logs display the following errors and the workflow fails:

Error when creating branch
RequestError [HttpError]: Error creating Pull Request: Reference update failed
422
tysonnero-ccm commented 2 months ago

Turns out this has nothing to due with a non-default branch. It's probably an issue with some repo setup. The create reference GitHub API doesn't return error details, so there is no way to know the issue from the response.