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

How to get BITBUCKET Repository name in bitbucket pipeline script

Mariya November 12, 2018

Is there way to get Repository name in bitbucket pipeline script ?
For example we can access branch name is building by using env  $BITBUCKET_BRANCH, similarly is any env variable name for repo name ?
such as BITBUCKET_REPOSITORY ?

2 answers

1 vote
Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2018

Hi @Mariya,

you can use $BITBUCKT_REPO_SLUG

A full list of environment variables can be found here: https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html

0 votes
Dwza S August 28, 2022

Is there a reason why $BITBUCKET_REPO_SLUG turns the string to lowercase?
This ist actually a Problem since I need the Slug in the Pipline to create a folder. The Folder is a Pluginname to the same time and if the CamelCase structure does not fit to the files inside the plugin, the plugin wont work. 

Sadly i always have to create project variable with the repo name... 

Is there a way to prevent lowercasing the slug? This would save me from editing the pipeline file for every project!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events