Aborting merged PR builds

Hello!

When we finalize a PR, we rebase and then fast forward merge. When we rebase a PR, bitrise starts building (because we enabled that webhook) and then when we merge, we close the source branch and then bitrise build fails because git clone fails. Is there any way to abort a build when a PR is merged? Or postpone a build after PR is updated?

Kind regards

Hi @bahadir.onc!

Of course, there are multiple ways to do so :slight_smile:

The evident one is of course with the on-site button, but you could also use the API to do so. Triggering and aborting builds | Bitrise DevCenter

Another feature we have that could help this situation is set up so you have to manually approve PR builds to run. You can read more about that here: Approving Pull Request builds | Bitrise DevCenter

Thanks for the help, @bitce

These options are not the ones we’re looking for. We though about something like:

  1. When the PR is merged, bitbucket calls bitrise webhook/api to abort the PR
    or
  2. PR building job is delayed for a couple of minutes so when we merge, the job is never run.

The API approach is the closest thing we can use, but we’d need to implement our own server which uses both bitbucket and bitrise API’s, right?

Regards

No, you’d just need to make a call for the Bitrise API :slight_smile: If you could find a way to automate that based on merges, that would be the ideal solution, otherwise I’m not sure you could get Bitbucket to send these requests or delay a hook :confused:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.