It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Determine tag that triggered build


I have a build that is triggered by tags matching a wildcard expression (e.g. server-*). I would like to find out the exact tag that triggered the build and use it in my build script. Does anyone know if this is possible?

I imagine I could use something like:

git tag -l --points-at HEAD

to get the tags on the current commit but there is every possibility in my situation that the same commit may end up with multiple matching tags. I have searched for predefined variables supplied by Bitbucket but cannot find anything. It would be great if it supplied variables like TRIGGER_BRANCH, TRIGGER_TAG or something that I could reference.

thanks for any advice,


1 answer

0 votes

Hi Steven,

There are default environment variables you can use, such as


See our documentation.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

994 views 1 16
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you