Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Pipelines - Trigger build on tag to master only

David Jackson
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!
February 28, 2024

I'd like to trigger a pipelines build when a tag is created on the master branch only. How would I do this?

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 29, 2024

G'day @David Jackson !

Welcome to the Bitbucket Cloud community! :)

You would need to make use of the tags trigger condition, you can find more information in our documentation:

Basically, you would define this in a similar method to branches - for example:

pipelines: 
tags:
'master':
- step:
script:
- echo "Hello world!"
  

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

Giorgi Rekhviashvili
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!
June 3, 2024

Hi @Ben , 

your example will trigger any branch with tag 'master'. 
Question is different. How to trigger only master or main branch with tag and not other branches. 

Thx!

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 3, 2024

Hi @Giorgi Rekhviashvili 

This was proposed as a feature, but our developers declined its implementation due to a lack of customer demand - please see the comments for further context:

At this stage, branch triggers will trigger whenever there is any kind of push to the branch - this includes commits and tags.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events