---
title: Integrating CircleCI with Mergify
description: How to automate your CircleCI workflow using Mergify
---

import circleciLogo from "../../images/integrations/circleci/logo.svg"
import IntegrationLogo from "../../../components/IntegrationLogo.astro"

<IntegrationLogo src={circleciLogo} alt="circleci logo"/>

[CircleCI](https://www.circleci.com/) is a modern CI/CD platform that allows
you to build, deploy, and automate your projects. Mergify can interact with
CircleCI by evaluating [the status
checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks)
reported by CircleCI to GitHub. This enables powerful automation workflows that
react to the results of your CircleCI jobs.

## Prerequisites

Before you can use Mergify with CircleCI, ensure the following:

1. CircleCI is properly set up and is building your projects. See the [CircleCI
   Documentation](https://circleci.com/docs/getting-started/) for help with
   setting up CircleCI.

2. CircleCI is configured to report build statuses to GitHub. This is typically
   done by installing [CircleCI's GitHub
   App](https://circleci.com/docs/github-apps-integration/).

3. The [Mergify GitHub App](/integrations/github) is installed in your repository.

## Using CircleCI Status Checks in Mergify Configuration

Once CircleCI reports status checks to GitHub, they can be used as conditions in
your Mergify rules. Here's a simple example:

```yaml
pull_request_rules:
  - name: Automatically merge when CircleCI build succeeds
    conditions:
      - "check-success = ci/circleci: test"  # Change this to match your CircleCI check name
      - "#approved-reviews-by >= 1"
    actions:
      merge:
        method: merge
```

In this example, Mergify will automatically merge pull requests that have at
least one approved review and a successful CircleCI build.

:::note
  The `check-success` check name should match the name of the CircleCI check
  reporting to GitHub.
:::

## Further Configuration

The possibilities of integrating CircleCI with Mergify are extensive.
For instance, you could use Mergify to:

import CIFurther from './_ci-further.mdx'

<CIFurther />
