Can't see variable exposed with envman

Hello,

I am trying to expose a value and use it in the script which is attached to the build process of my application. I have a script that exposes the value:

envman add --key MAPS_API_KEY_DEV --value "$IOS_GOOGLE_MAPS_API_KEY_DEV"

However, when I run the workflow with remote access I can’t see the value with printenv. Also when I try to run envman on the remote machine it says that the command was not found. Any suggestions?

Howdy! There’s a few things to be aware of here.

First, envman is only available inside the workflow that’s executed. It’s not available from the rest of the machine. As a result you’re not going to be able to run the envman command when remoted in. (At least not without doing some additional overhead to set it up).

Second, variables added with envman are scoped. If you haven’t read through this yet, I recommend it: https://devcenter.bitrise.io/tips-and-tricks/expose-environment-variable/

Finally, I’m guessing that $IOS_GOOGLE_MAPS_API_KEY_DEV is defined in your secrets tab?

If so, be aware that you need to toggle the “Expose to Pull Request” button for your variable to be available when a workflow is triggered via PR. You may also need to toggle the “Replace variables in inputs” button depending on your config.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.