GitHub

Available environment variables

Environment Variables (Env Vars) consist of a key and a value, as well as optional attributes. They can be defined on the level of apps, Workflows or Steps.

Exposed by the Bitrise CLI

These Environment Variables are available everywhere, even if you run the build on your own computer, using the Bitrise CLI.

The ID of the Workflow that was triggered. This env var is exposed regardless of whether the Workflow was triggered manually or automatically.

The title of the Workflow that was triggered - if it has a title, which is completely optional. This env var is exposed regardless of whether the Workflow was triggered manually or automatically.

The current status of the build. The available options are:

  • Not finished (0)
  • Successful (1)
  • Failed (2)
  • Aborted with failure (3)
  • Aborted with success (4).

Path to the base working directory. By default, it’s the directory where Bitrise runs (for example, your repository root), unless you provide a different value. Can be overwritten during the build, which will change the working directory for subsequent Steps in the build.

Path to the directory that stores artifacts and files for deployment. It’s a temporary directory created by the Bitrise CLI by default, and can be overwritten before starting the Bitrise CLI. The Deploy to Bitrise.io Step looks for your build artifacts - such as an IPA or APK of the app -, test results, and other files in this directory.

Indicates whether the Bitrise CLI is running in CI (Continuous Integration) mode. Value can be true or false. It is false if, for example, your run Bitrise on your own computer.

Indicates whether the Bitrise CLI is running in PR (Pull Request) mode. Value can be true or false. Running in Pull Request mode means that Bitrise builds your code in the state as if the Pull Request was already merged.

Exposed by Bitrise.io

These Environment Variables are available for builds running on bitrise.io virtual machines.

Build number of the build on bitrise.io. You can modify any app’s build number if you want to - for example, if you wish to reset to 1.

The title of your app on bitrise.io. You can change it any time on the Settings tab of the app.

The URL or your app on bitrise.io. This is not the same as the git repository URL! An app URL has the following format:

app.bitrise.io/APP-SLUG/

The slug that uniquely identifies your app on bitrise.io. It’s part of the app URL, too.

The URL of the build on bitrise.io. A build URL has the following format:

app.bitrise.io/build/BUILD-SLUG

The slug that uniquely identifies a build on bitrise.io. It’s part of the build URL, too.

The time when the build was triggered.

The URL of the Git repository that hosts your app. This can be changed in the Settings tab of the app.

The git branch that is built by Bitrise. For example, master.

Used only with builds triggered by pull requests: the destination/target branch of the pull request that triggered the build.

You can use Git Tags to trigger builds on Bitrise: this Env Var stores the tag used to trigger the build.

The commit hash of the git commit that triggered the build, when applicable. There is no commit hash, for example, in the case of a pull request build.

The commit message, pull request title or the message you specified if you triggered the build manually.

The owner of the Git repository of the app (for example, bitrise-io).

The slug of the Git repository of the app (for example, devcenter).

The ID of the pull request that triggered a build. Not applicable, of course, if the build was not triggered by a pull request.

The URL of the repository from where the pull request has been sent.

The pre-merge branch - if the Git hosting provider supports and provides the pre-merged state of a pull request on a special merge branch.

The pull request head branch, if the Git hosting provider system supports and provides this. This special git ref should point to the source of the pull request.

The URL of the Apple provisioning profiles uploaded to bitrise.io. If there is more than one provisioning profile uploaded for your app, a pipe character separates the URLs in the list (|).

This is only relevant for iOS apps and for cross-platform apps with iOS versions.

The URL of the Apple certificates uploaded to bitrise.io. If there is more than one certificate uploaded for your app, a pipe character separates the URLs in the list (|).

This is only relevant for iOS apps and for cross-platform apps with iOS versions.

The passphrase you set for the uploaded Apple certificates on the app’s Code Signing tab. If there is more than one certificate with a passphrase, a pipe character separates the phrases in the list (|)

This is only relevant for iOS apps and for cross-platform apps with iOS versions.

Indicates that the build is running in a bitrise.io environment. Value is set to true by bitrise.io when it starts a build.

For more information on Env Vars, check out Secrets and Env Vars.