ENV vars not showing up in workflow?



I’m currently using a curl command to trigger a bitrise build:

curl https://www.bitrise.io/app/XXXXXXX/build/start.json \
--data '{"hook_info":{"type":"bitrise","api_token":"XXXXXXXX"},"build_params": {"tag":"XXXXXXXX"},"environments":[{"mapped_to":"SOME_ENV_VAR","value":"1234","is_expand":true}]}'

In the workflow that gets kicked off for the resulting build, I have a script step that does this:

set -ex

# write your script here
echo "value = $SOME_ENV_VAR"

but all I see in the logs are:

+ echo 'value = '
value =

Why is the SOME_ENV_VAR not showing 1234 in the logs when the script step gets run?

Even when I echo the environment vars list with “printenv”, I don’t see it in the logs, either.

From what I understand, these APP ENV vars should be available in the workflows…What exactly am I missing?



I had the wrong nesting for the json data I was posting:

It should look like this:

--data '{"hook_info":{"type":"bitrise","api_token":"XXXXXX"},"build_params":{"tag":"XXXXXXX","environments":[{"mapped_to":"SOME_ENV_VAR","value":"1234","is_expand":true}]}}'



Just for future reference, it’s also worth to mention that you can’t overwrite env vars defined in your config (bitrise.yml) with API defined env vars just by specifying the env var through the API call.

If you want to do that please follow this guide:

1 Like


Could we get this added to the docs?

Currently the example is as follows with no mention that it should be a property of build_params:

  {"mapped_to":"API_TEST_ENV","value":"This is the test value","is_expand":true},
  {"mapped_to":"HELP_ENV","value":"$HOME variable contains user's home directory path","is_expand":false},


Hi @nmwilk,

The docs are open source. Please feel free to file a pull request over on https://github.com/bitrise-io/devcenter.