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

Manual build in bitbucket pipelines - how to find tags?

Alistair Hopkins December 21, 2017

Hi

I want a manually triggered pipeline in which I react differently according to whether or not there's a tag on the repo at that point

$BITBUCKET_TAG seems to be empty if I trigger a pipeline on a commit which has a tag

Is there any way of finding out if there's a tag and what the value is?

Thanks

Al

1 answer

1 vote
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 27, 2017

Hi Al,

Bitbucket Pipelines allows for configuring pipelines based on tags being pushed, rather than commits. See here for documentation: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-ci_tags

The $BITBUCKET_TAG variable will only be populated on a build with a tag configuration (as above).

Otherwise you can use the git tag list command, but you may need to enabled full clone (we automatically do a shallow clone for clone speed optimisation): https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-ci_clone

Does that help?

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events