Pass environment variable when calling lane

When using the fastlane step, is there a way to pass environment variable like this: DELIVER_USER="" fastlane test? Or would I need to use a script step that installs fastlane, and then runs the lane with the environment variable using the syntax above?

1 Like

App Env Vars, or workflow env vars, or any other env var should work.

DELIVER_USER="" fastlane test is the same as

export DELIVER_USER=""
fastlane test

And env vars work the same way (export just sets the env var) regardless how you set them.

So, just simply add e.g. an App Env Var to your bitrise config with the key DELIVER_USER and the value

Using the secret environment variables did the trick.

1 Like

Thanks for reporting @eman6576! :wink:

Just one note: Secrets are fine if the value should not be accessible for Pull Request builds. If it should, you should use App Env Vars instead. Both are exposed as env vars, so if it works with Secret Env Vars it’ll work with App Env Vars too, the difference is that App Env Vars are available for PR builds too (and are stored as part of the build config, while Secrets stored separately, but exposed as env vars too, for non PR builds).