Hi All,
On my project, and unfortunately, I lost and forget some variable values. How do I get the value of repositories variable of my bitbucket project? I'm an admin in my project. Is there any chance to reverse back the variable values?
Thanks
Hi, @Revan Hernandy!
Thank you for reaching out to Atlassian Community!
Before we start, I’d like to confirm what is happening on your side. Feel free to correct me in case I have misunderstood something here. You mentioned you lost and forgot some variable values on your repository. Could you please clarify if the variables have been deleted, or if you just don’t remember their values, but they are still there?
If you still have the secured variables, you can find out their values. You can achieve that by going to your yml file > echo the variable in a file that you define as an artifact > and then you can see the value of the variable if you download the artifact.
This is an example of how to retrieve a secured variable’s value with artifacts:
script: - echo $variable > variablevalue.txt artifacts: - variablevalue.txt
Looking forward to hearing from you.
Kind regards, Caroline
Hi Caroline,yes, I lost/forget some necessary credentials there and I need to know the value of the variables.
what pipe can I use? atlassian/ssh-run:0.2.2 ?
if yes what mode can I use? script or command?
thank you!
Hi, @Revan Hernandy,
Could you please clarify which type of variables you are using in this YAML file? Does it get the values for secured Pipelines variables defined on a repository or workspace level, deployment variables, or some variables on your server?
If these variables are set in Repository settings > Repository variables (secured), you should be able to retrieve their secured values using any image (for example, atlassian/default-image:3), and you just would need to add this to your YAML file:
Then download the artifacts by accessing the successful build > open Artifacts > Download artifact.
I hope this clarifies the process, but please let me know if you face any obstacles.
Kind regards,Caroline
@Caroline R it worked thank you!
It looks like you're new here. Sign in or register to get started.