You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Can anyone confirm if the BITBUCKET_BRANCH works in custom pipelines? I just tried it and it worked in the feature branch that I'm working on, but the documentation here says it's not available in Custom Pipelines. Something that may make a difference is I'm using Deployment environments in my pipelines, so not sure if that allows it to work?
Basically, I'm after Atlassian to say it's supported in custom pipelines, or the community to say that you use it and it works. Just looking for that reassurance before putting it into production.
I should mention that any articles I've found on this question are 4 or 5 years old, so I'm looking for a more up to date answer.
Hello @Scott Nickless ,
Thank you for reaching out to Atlassian Support.
It depends on how you trigger the custom pipeline. If you trigger it from the Pipelines page > Run pipeline, where a panel will show up and you have to select the branch for which the pipeline will run, then yes, the value of $BITBUCKET_BRANCH will be available in the build.
However, if you trigger the pipelines by directly accessing a commit from the Commits page, and then clicking on Run pipeline option on the left side of the page, the build will be triggered specifically for that commit and with no reference to a branch, so $BITBUCKET_BRANCH will be empty within the build steps.
Hope that helps to clarify your questions.
Thank you, @Scott Nickless .