Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to access secured repository variables in windows runner?

Chris
September 6, 2023

Hi!

When accessing repository variables in my windows runner pipeline via

$env:SOME_VAR 

everthing works EXCEPT when the variable is set to be "secured"! In that case the ENV is not set/empty!

How to access secured variables? Am i missing something or is this a bug?

2 answers

1 accepted

0 votes
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2023

Hi @Chris,

Thank you for reaching out to the community.


You can safely access secured variables by following the solutions mentioned in this knowledge-based article. - How to safely export secured variables in bitbucket pipelines

Regards,
Mark C

Chris
September 7, 2023

I can access all types of variables in our Linux runner, but with a Windows runner only "unsecured" aka normal variables work!

Chris
September 8, 2023

sorry, my bad! got it working now by additionally en-/decoding the secured values with base64

0 votes
Daan Baas
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!
December 8, 2025

Hi, 

We have exactly the same problem @Chris descibes. We use a Windows Self-Hosted runner, and we are trying to send a build artifact (installer package) to the Downloads section of our repository. 

We already wasted a full day on this, trying different options. To verify whether the use of 'secured' variables in combination did not cause problems with the 

$env:SOME_VAR 

 syntax in our bitbucket-pipelines.yml, we tried using un-secured variables. With unsecured variables, our scripts can read the repository variables. I tried reading the knowledge-based article. - How to safely export secured variables in bitbucket pipelines
mentioned above, but it does not exist anymore. 

Suggest an answer

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

Atlassian Community Events