Issue:
An Environment Variable (Env Var) is needed to be available for an entire Bitrise Organization but Env Vars are only available at the app level and the Workflow level.
Possible solutions:
Upload a file that contains the Env Var definitions in the following format to the Generic File Storage:
Note that you need to provide a unique ID for the file when you upload it to the Generic File Storage. You will need this ID later!
testvar=testvaluetestvar2=testvalue2
Add a Personal Access Token to your account to be able to authenticate with the Bitrise API.
Add a Script Step to the Workflow. We'll use this to download the file from the other app using the Bitrise API.
Add the API command to the Script content input of the Script Step. You will need your API key, the app slug of your app, and the ID of the file you uploaded to Generic File Storage:
curl -X GET -H "Authorization:<access-token>" "https://api.bitrise.io/v0.1/apps/{app-slug}/generic-project-files/{generic-project-file-ID}" > file
Add another Script Step to your Workflow. We'll use this to get the file contents and add them to the Env Vars:
#!/usr/bin/env bashfile="$1" while IFS="=" read -r key value; do if [ ! -z "$key" ] ; then envman add --key "$key" --value "$value" fi done < "$file"