Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to prevent a Bitbucket build from running on every change in the Bitbucket Pull Requests

Ankita Singh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 4, 2025

 

I have a repository on bitbucket which initiates a build to run on every change I make to the bitbucket UI like adding reviews, changing description etc. I want the build pipeline to only run when I am updating the code after git commit/ git push.

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2025

Hi @Ankita Singh and welcome to the community!

Could you please confirm the following:

  • Are you using Bitbucket Cloud or Bitbucket Data Center? I see that your question has the tag 'bitbucket-cloud', but I don't see a Bitbucket Cloud account with your email address. If you are unsure which one you use, the URL of a Bitbucket Cloud repo on your browser starts with https://bitbucket.org/, while Bitbucket Data Center repos have a different, custom URL.
  • If you are using Bitbucket Cloud, do you run your builds with Bitbucket Pipelines, or do you use a different CI tool?

If you are using Bitbucket Cloud Pipelines and you have pull-requests definitions for your builds, these builds should run every time a PR is created or new commits are pushed to the PR's source branch. They shouldn't run with any other updates like editing the PR's description, etc. Do you encounter this issue with Bitbucket Cloud Pipelines builds that are configured to run on pull-requests?

If you are using a third-party CI/CD tool, these builds are typically triggered using a Bitbucket webhook, as Saxea _Flowie_ mentioned. A webhook with trigger pullrequest:updated will be triggered with every change in a PR. It is up to the system receiving the webhook payload to examine if there are changes in the PR's commits and trigger a build only in this case and not with any other change.

If you are using a third-party integration that is based on a webhook with trigger pullrequest:updated, you can check if there is any built-in configuration in it to prevent builds for PR changes other than new commits. If such a configuration doesn't exixt, you'll need to reach out to the integration's developers and ask them to provide this functionality or look for a different integration that already has this functionality built in.

Kind regards,
Theodora

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 4, 2025

Hi @Ankita Singh

The build is typically triggered using a Bitbucket webhook. You can configure the webhook to  trigger using the repo:push or pull request update events. Bitbucket will emit an 'update' event for any of the changes you mentioned. It doesn't provide more granular events out of the box though. You could try to set it to repo:push only and see if fits your needs.

Otherwise, we provide an Bitbucket app, Flowie, that adds support for greater flexibility and control to when the builds are triggered. You can use set it to trigger the PR build only when there are code changes and no conflicts, for instance. Or just trigger integration builds once there is a review. If you are interest get in touch support@flowie.app and we are happy to assist you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events