jwalton/gh-find-current-pr

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

auto-rajeevrahi opened this issue · 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
       

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.

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?