gh-find-current-pr icon indicating copy to clipboard operation
gh-find-current-pr copied to clipboard

Can I provide branch-name to find the PR number?

Open auto-rajeevrahi opened this issue 3 years ago • 2 comments

Right now We are not able to get the details of PR of a particular branch. It only gets the details of base branch. Can you please implement, where we can provide branch name to find the pr details? like below:

    - name: Identify Pull request number
      uses: jwalton/gh-find-current-pr@v1
      id: findPr
      with:
        state: open
        branch: my-branch-name
       

auto-rajeevrahi avatar Jan 27 '22 11:01 auto-rajeevrahi

I'm afraid I'm not really sure what you're asking for here. You want to only find PRs where the hash is the current hash, and the base branch is a particular branch? Do you have two open PRs against the same commit going to different branches?

If this is what you're after, I don't think this should be too hard to do. If you look at the content of a PR object, I think you want to filter the returned PRs by pr.base.ref === targetBranch. Give that a try, and if it works for you, feel free to submit a PR.

jwalton avatar Jan 27 '22 22:01 jwalton

I also need this, the problem is that there could be multiple PRs from my-branch-name to some destination. Maybe it should return a PR number that has my-branch-name against the default branch?

oreporan avatar May 15 '22 07:05 oreporan