question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to create 2 pull requests from the same branch

See original GitHub issue

Subject of the issue

Attempt

Trying to create 2 PRs from the same branch

Result

One PR is created and instantly closed. (when the second PR is about to be created, the first one gets closed instead)

Expected

Two different PRs to be created

Steps to reproduce

  1. Add these 2 steps to a workflow.
      - id: create_pr_to_development
        name: Create PR to development
        uses: peter-evans/create-pull-request@v4
        with:
          base: development
          branch: BRANCH_NAME
          delete-branch: false
          title: Merge `${{ env.branch_name }}` into `development`
          body: Automated PR from create-candidate github action. Merge this when candidate is released.

      - id: create_pr_to_main
        name: Create PR to main
        uses: peter-evans/create-pull-request@v4
        with:
          base: main
          branch: BRANCH_NAME
          delete-branch: false
          title: Merge `${{ env.branch_name }}` into `main`
          body: Automated PR from create-candidate github action. If you merge this, a new production build will be triggered.

  1. Replace BRANCH_NAME with a branch that exists
  2. Make sure branches main and development exists or rename those branches above 👆

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
peter-evanscommented, Nov 29, 2022

@oliversalzburg I’ve worked on an enhancement to the action to support your use case. It’s a potentially breaking behaviour change for the action, so I will need to release it as a new major version. Until the release, you can use the beta version with tag v5-beta.

You should be able to do this in your workflow now:

- uses: peter-evans/create-pull-request@v5-beta
  with:
    add-paths: |
      ./packages/payment-models/index.d.mts
    branch: feat/update-tsd
    
- uses: peter-evans/create-pull-request@v5-beta
  with:
    add-paths: |
      ./packages/infrastructure/lambda-schema.yaml
    branch: feat/update-openapi-components

(I removed setting the base explicitly because it should be unnecessary if you are already checked out on the next branch when the action executes)

0reactions
oliversalzburgcommented, Nov 30, 2022

Oh nice! Seems like I missed the earlier notification.

Right now, we’re using multiple workflows, and already build a lot of stuff around that approach now. The pipelines I was working on earlier, served as blueprints for another team who is now in charge of handling all the CI.

As I am using your action in a lot of places, I am very likely to get back to this though. I very much appreciate you looking into this and I will share my feedback once I have it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to open multiple pull requests on GitHub - Stack Overflow
Pull requests are based on a branch. The only way to open up a pull request for multiple commits is: Isolate them into...
Read more >
Solved: If a pull request is not yet closed can I create o...
There can be only one open PR from a given branch. However, you can create a new branch from the tip (branch is...
Read more >
Handling multiple pull requests from a branch
Pull requests are branch -> branch, the idea of having multiple pull requests from one branch to another doesn't make sense. · Sprint...
Read more >
Multiple pull requests on the same branch - GitLab Forum
Hi, I'm pretty new to Gitlab and we're rolling it out to our dev team. I have come from a Git & Gerrit...
Read more >
Creating a pull request - GitHub Docs
Create a pull request to propose and collaborate on changes to a repository. ... Pull requests can only be opened between two branches...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found