Skip to main content

is_ci

Function is_ci 

Source
pub fn is_ci() -> bool
Expand description

Check if the current process is running in a CI environment.

This checks for common CI environment variables used by popular CI/CD systems:

  • CI - Generic CI indicator (GitHub Actions, GitLab CI, CircleCI, Travis CI, etc.)
  • GITHUB_ACTIONS - GitHub Actions
  • GITLAB_CI - GitLab CI
  • BUILDKITE - Buildkite
  • JENKINS_URL - Jenkins
  • CIRCLECI - CircleCI
  • TRAVIS - Travis CI
  • BITBUCKET_PIPELINES - Bitbucket Pipelines
  • AZURE_PIPELINES - Azure Pipelines
  • TF_BUILD - Azure DevOps / Team Foundation Build
  • DRONE - Drone CI
  • TEAMCITY_VERSION - TeamCity

Returns true if any of these environment variables are set to a truthy value.