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

is it possible to not run on branch push pipeline when the latest push has a tag?

Siddhant May 27, 2022

i am using a tag based release. When i want to release i tag the commit with release-${version} and push it. But doing so, causes two pipelines to run one for the push on master and another for the tag. is it possible to just run tag pipeline and not the push pipeline if the latest pushed commit has a tag.

1 answer

1 accepted

1 vote
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 29, 2022

Hi @Siddhant

Welcome to the community.

Unfortunately, it's not possible to stop a branch push trigger when there's a specific tag on a push.
As a workaround, you can add a script in the branch/default trigger that validates if a pushed commit has a specific tag.
Then return exit command to stop executing the build further.

pipelines:
  default:
    - step:
        name: Default trigger
        script:
          - # validate if there's a tag then return exit to stop executing the build further
          - #Some scripts here
  tags:
    release-*:
      - step:
          name: Release
          script:
            - #Some scripts here

Hope it helps and do let me know if you have further questions that I can help with.

Regards,
Mark C

Siddhant May 31, 2022

Thanks for replying.
This will definitely save some of the build minutes...
Btw, Is there any chance of this kind of feature being added in near future?

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 1, 2022

Hi @Siddhant

We do have an existing feature request for it that can be located through this link. - https://jira.atlassian.com/browse/BCLOUD-20192
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.
Please do note that we don't have an exact ETA for the feature request as all new features will be implemented according to our policy here.

Hope it helps and let me know if you have further questions.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events