How can I detect that a merge triggered via API completed?

I do have a script that detects if a pull request exists and merges it. It then pulls the repository locally.

The problem is that the API operation completes before Bitbucket has completed the merge, so the pull does not contain the merge just done.

Waiting 30 seconds does not solve the problem reliably, and I sense that waiting any specified amount of time is a workaround rather than a good solution.

How can I know in the script that the merge completed? Can I make the API operation work synchronous and only return after it has done all work? I want to avoid having to pull the repo until I see a commit containing some text with the merge number in it.

0 answers

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,986 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you