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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.