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,369,659
Community Members
 
Community Events
168
Community Groups

How to get BITBUCKET Repository name in bitbucket pipeline script

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

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

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

Atlassian Community Events