How to get pull_number for specific pull request Github v3?

Hi,
I am trying to write an automated PR merger. pull_number is an important bit to perform the action according to Github API v3.
Can anyone guide me on how to get this pull_request number for automerging?
If you already have any code for it, please direct me to that as well.

:wave: hello there and welcome to the GitHub Support Community, @munai-das!

I think it depends on what your building: be it a workflow leveraging GitHub Actions, a GitHub App, or something else.

It may be worth noting that the documentation for the Merge a pull request endpoint also includes some code samples for making a request to that endpoint.

If you’re writing a workflow leveraging GitHub Actions, here’s an example workflow that automatically merges pull request based on the value of the base ref and the head ref, along with a pull request that was automatically merged to showcase its functionality. If you’re just getting started with GitHub Actions, this GitHub Actions: Hello World module on our Github Learning Lab might be of interest. Hope this helps!

1 Like