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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,942
Community Members
 
Community Events
176
Community Groups

BITBUCKET_BRANCH Variable in Custom Pipelines

Edited

Hi All,

 

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.

 

Thank you

1 answer

0 votes
Patrik S Atlassian Team Aug 01, 2022

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 .

Kind regards,

Patrik S.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events