# How to get the pull request number on main branch merges?

**URL:** <https://forum.buildkite.community/t/how-to-get-the-pull-request-number-on-main-branch-merges/1262>\
**Category:** General\
**Created:** [October 5, 2020, 4:33pm UTC](https://forum.buildkite.community/t/how-to-get-the-pull-request-number-on-main-branch-merges/1262 "2020-10-05T16:33:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrav](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@shrav](https://forum.buildkite.community/u/shrav)\
**Post date:** [October 5, 2020, 4:33pm UTC](https://forum.buildkite.community/t/how-to-get-the-pull-request-number-on-main-branch-merges/1262/1 "2020-10-05T16:33:46Z")

</div>

Hello

I am trying to find out the GitHub pull request number on the main branch merge builds. I tried using `BUILDKITE_MESSAGE` but it’s not reliable. Any suggestions on better alternatives are much appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![Jason](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jason/32/742_2.png) [@Jason](https://forum.buildkite.community/u/Jason)\
**Post date:** [October 6, 2020, 2:18am UTC](https://forum.buildkite.community/t/how-to-get-the-pull-request-number-on-main-branch-merges/1262/2 "2020-10-06T02:18:50Z")

</div>

Hey Shrav,

Can you use BUILDKITE\_PULL\_REQUEST?

If you’re still having trouble, send us through a message with you pipeline/build details to [support@buildkite.com](mailto:support@buildkite.com) and we can help you out there.
