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.
Currently the example is as follows with no mention that it should be a property of build_params:
"environments":[
{"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},
]
It will be good that the documentation clarifies that environments should be inside of build_params… I lost a couple of hours just trying to figure out why this didn’t work:
{
"hook_info": {
"type": "bitrise"
},
"build_params": {
"branch": "the-pr-branch",
"branch_dest": "master",
"pull_request_id": 133,
"skip_git_status_report": "true"
},
"environments":[
{"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},
]
}
It is not really clear from the documentation that it should be:
{
"hook_info": {
"type": "bitrise"
},
"build_params": {
"branch": "the-pr-branch",
"branch_dest": "master",
"pull_request_id": 133,
"skip_git_status_report": "true",
"environments":[
{"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},
]
}
}