Can you use a workspace variable to specify a pipe version?

michael.reeves
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2023

I want to be able to centrally control the version of a pipe with a variable but currently this approach does not work:

I set a workspace variable SONARCLOUD_SCAN_VERSION to "2.0.0"

- pipe: sonarsource/sonarcloud-scan:${SONARCLOUD_SCAN_VERSION}

but it failed with:

Configuration error

It looks like you tried to use a pipe in your bitbucket-pipelines.yml that doesn’t exist. Check the name of the pipe and try again.

You seem to need to do this with a hard coded version but we have 200+ repos all using this pipe so I'd prefer to centrally manage that:

- pipe: sonarsource/sonarcloud-scan:2.0.0

2 answers

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2023

Hello @michael.reeves, and welcome to the Community!

Unfortunately, currently the pipe name in Bitbucket Pipelines does not support parsing environment variables. We do have an open feature request to include the usage of variables in the pipe name, which you can access using the below link :

We encourage you to add your Vote on that feature ticket, as it helps the product managers to understand the interest. Also, make sure to add yourself as a Watcher in case you want to receive first-hand updates whenever there's any progress on the implementation of that feature.

Thank you, @michael.reeves !

Patrik S

michael.reeves
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 17, 2023

Thanks for the quick reply. 

1 vote
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 3, 2024

Hi all,

 

Here is an article and a video with a working example of how this can be achieved using Dynamic Pipelines and a Forge app.

 

The example shows how to replace the variable in an image name, but it can also be used as-is to substitute pipe names.

 

Hope this helps,
Caterina

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events