I'm trying to access a variable (unsecured) in a script to create a .env file before building, but the file is always created empty. The plan is to base64 decode it, but right now I'm just trying to access it at all. As far as I can read only secured variables should be restricted. What am I missing?
Screenshots below
Thanks!
script:
- echo $ENV_FILE > .env.local
- cat .env.local
- yarn install
- yarn build
Hi Chris,
Thanks for reaching out to Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you!
This sounds interesting, can you try to do only the "echo $ENV_FILE" command and let me know whether if it shows the environmental variable? Also, can you let me know if you're using Runners or are you running it on our Pipelines infrastructure?
Please let me know.
Best Regards,
Norbert
Atlassian Bitbucket Cloud Support
Hi Norbert,
I figured it out myself eventually - this was a deployment level variable which I didn't realise would not be available in non-deployment steps. I have moved it to a repository level variable which is now working.
Thanks for he reply
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
Thank you for your reply, I'm glad to hear your issue is resolved :).
Have a lovely weekend ahead and stay safe!
Best Regards,
Norbert
Atlassian Bitbucket Cloud Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.