<commit_before><!--

title: Environment variables
last_updated: Apr 13, 2015

-->

We export a number of environment variables during each build, which you may find
useful for more complex testing or deployment.

### Basics

Ideally, you won't have code which behaves differently in CI. But for the cases
when it's necessary, we set two environment variables which you can test:

<dl>
  <dt>
    `CIRCLECI`
  </dt>
  <dd>
    true
  </dd>
  <dt>
    `CI`
  </dt>
  <dd>
    true
  </dd>
</dl>

### Build Details

We publish the details of the currently running build in these variables:

<dl>
  <dt>
    `CIRCLE_PROJECT_USERNAME`
  </dt>
  <dd>
    The username or organization name of the project being tested, i.e. "foo" in circleci.com/gh/foo/bar/123
  </dd>
  <dt>
    `CIRCLE_PROJECT_REPONAME`
  </dt>
  <dd>
    The repository name of the project being tested, i.e. "bar" in circleci.com/gh/foo/bar/123
  </dd>
  <dt>
    `CIRCLE_BRANCH`
  </dt>
  <dd>
    The name of the branch being tested, e.g. 'master'.
  </dd><commit_msg>Add the CIRCLE_TAG env var to the docs<commit_after><!--

title: Environment variables
last_updated: Apr 13, 2015

-->

We export a number of environment variables during each build, which you may find
useful for more complex testing or deployment.

### Basics

Ideally, you won't have code which behaves differently in CI. But for the cases
when it's necessary, we set two environment variables which you can test:

<dl>
  <dt>
    `CIRCLECI`
  </dt>
  <dd>
    true
  </dd>
  <dt>
    `CI`
  </dt>
  <dd>
    true
  </dd>
</dl>

### Build Details

We publish the details of the currently running build in these variables:

<dl>
  <dt>
    `CIRCLE_PROJECT_USERNAME`
  </dt>
  <dd>
    The username or organization name of the project being tested, i.e. "foo" in circleci.com/gh/foo/bar/123
  </dd>
  <dt>
    `CIRCLE_PROJECT_REPONAME`
  </dt>
  <dd>
    The repository name of the project being tested, i.e. "bar" in circleci.com/gh/foo/bar/123
  </dd>
  <dt>
    `CIRCLE_BRANCH`
  </dt>
  <dd>
    The name of the git branch being tested, e.g. 'master', if the build is running for a branch.
  </dd>
  <dt>
    `CIRCLE_TAG`
  </dt>
  <dd>
    The name of the git tag being tested, e.g. 'release-v1.5.4', if the build is running [for a tag](https://circleci.com/docs/configuration#tags).
  </dd>
{'fraction_non_alphanumeric': 0.1184549356223176, 'fraction_numerical': 0.011587982832618025, 'mean_word_length': 2.9575551782682514, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1452014', 'n_tokens_mistral': 865, 'n_tokens_neox': 832, 'n_words': 308}