You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
As part of the CI/CD pipeline, we want to validate whether a PR passes configured merge checks and is not in any conflict. I went through the cloud Rest documentation, but didn't find any api.
I see bitbucket ui makes a api call to /merge-restriction to get this info. Is there a similar api to consume?
If not what other alternatives I have to check whether a PR can be merged or not?
Hello @Siddharth Agrawal and welcome to the Community!
I'm afraid that for pull request merge check status in particular, Bitbucket Cloud currently doesn't expose a public API endpoint. We do have an open feature request to make this information available on the API, which you can find below :
I would suggest you to add your Vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a Watcher in case you want to receive first-hand updates from that ticket.
For getting the PR diff conflicts though, our development team is working on building a direct endpoint to fetch that information, but in the meanwhile you can use the Get Pull Request API endpoint to get the PR, and use the source and destination commit data to construct a direct diffstat request which will return the conflict status as part of the object.
Hope that helps! If you have any questions, please let us know.
Thank you, @Siddharth Agrawal !