Is there any possibility for me to set up a bitbucket pipeline which is triggered only when there is PR merged to a given specified branch ?
I noticed most PR events are when they are created or when there is a commit
Hi @Etunyi Ashime,
A pull-requests pipeline indeed gets triggered only when a PR is created or the source branch of the PR gets updated. Even though this type of pipeline doesn't get triggered upon merge, it will run on the merged code. In the Build Setup of each step, the repo will get cloned, the PR's destination branch will get merged into the PR's source branch in that clone, and then the commands of that step's script will be executed.
If you want to trigger a pipeline when the PR is merged to a specific branch, you could set up a branch pipeline for this branch:
This pipeline will also run when new commits are pushed directly to the specified branch as well as when a PR is merged into the branch. Using branch restrictions, you could prevent users from pushing directly to the branch without a PR, so then new commits to the branch will only be possible via a PR:
Kind regards,
Theodora
Not using just standard Bitbucket pipelines start conditions, however you can use Flowie's smart pipelines plugin which gives you greater control on when pipelines are triggered. You can define an event and/or a condition to trigger a pipeline. In your case, it would be PR merged event with a branch condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.