CI-Info: Continuous Integration Information

0.4.0 · active · verified Tue Apr 14

ci-info is a Python library that provides information about the current Continuous Integration (CI) environment. It allows developers to detect if code is running on a CI server, identify the specific CI provider (e.g., GitHub Actions, GitLab CI, CircleCI), and check if the current build is for a pull request. The library aims to maintain parity with `watson/ci-info` (a JavaScript equivalent) and is actively developed with a focus on adding new CI provider detections. The latest version is 0.4.0, released in February 2026.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to check if the current environment is a CI server, identify its name, and determine if the build is for a pull request using the `ci_info` module. It also shows how to retrieve all detected CI information in a dictionary.

import ci_info
import os

if ci_info.is_ci():
    print(f"Running on CI: {ci_info.name()}")
    if ci_info.is_pr():
        print("This is a Pull Request build.")
    else:
        print("This is not a Pull Request build.")
    
    # Example of accessing CI environment variables directly
    # os.environ.get('CI_NAME', 'Unknown')
    
    # Get all detected info as a dictionary
    all_ci_info = ci_info.info()
    print(f"All CI Info: {all_ci_info}")
else:
    print("Not running on a CI server.")

view raw JSON →