Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actions/create-and-merge-pull-request is failing when pull request exists already #265

Open
neilime opened this issue Apr 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@neilime
Copy link
Contributor

neilime commented Apr 25, 2024

Describe the bug

When using hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request, if the a pull request exist already, it sometimes fails: Error: Cannot read properties of undefined (reading 'number')

There is a flaw in the action peter-evans/create-pull-request: https://github.com/peter-evans/create-pull-request/blob/6d6857d36972b65feb161a90e484f2984215f83e/src/github-helper.ts#L91

To Reproduce

Create a pull request with the proper branch name, the call the hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request

Expected behavior

When this case occurs it should retry to create the pull request

Screenshots

Run peter-evans/create-pull-request@v6.0.0
  with:
    token: ***
    signoff: true
    base: main
    delete-branch: true
    branch: feat/deploy-www-pr-751
    title: feat(www): deploy 3.13.0-pr-751-e7b1d433 to review-apps
    body: Deploy 3.13.0-pr-751-e7b1d433 to review-apps
    commit-message: feat(www): deploy 3.13.0-pr-751-e7b1d433 to review-apps"
  
  [skip ci]
  
    author: github-actions[bot] <41898[28](https://github.com/aircorsica/argo-app-of-the-apps/actions/runs/8830909931/job/24245047467#step:9:33)2+github-actions[bot]@users.noreply.github.com>
    committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    draft: false
Prepare git configuration
Determining the base and head repositories
Pull request branch target repository set to aircorsica/argo-app-of-the-apps
Configuring credential for HTTPS authentication
Checking the base repository state
Pull request branch to create or update set to 'feat/deploy-www-pr-751'
Configuring the committer and author
Create or update the pull request branch
Pushing pull request branch to 'origin/feat/deploy-www-pr-7[51](https://github.com/aircorsica/argo-app-of-the-apps/actions/runs/8830909931/job/24245047467#step:9:59)'
Create or update the pull request
Restore git configuration*
  Attempting creation of pull request
  A pull request already exists for aircorsica:feat/deploy-www-pr-751
  Fetching existing pull request
  Attempting update of pull request
  Error: Cannot read properties of undefined (reading 'number')
@neilime neilime self-assigned this Apr 25, 2024
@neilime neilime added the bug Something isn't working label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant