Integrating Buildkite with Mergify
How to automate your Buildkite workflow using Mergify
Buildkite is a CI/CD tool providing scalable orchestration system, dynamic pipelines, customizable runners, and a great local development experience. Mergify can interact with Buildkite by evaluating the status checks reported by Buildkite to GitHub. This enables powerful automation workflows that react to the results of your Buildkite jobs.
Prerequisites
Section titled PrerequisitesBefore you can use Mergify with Buildkite, ensure the following:
-
Buildkite is properly set up and is building your projects. See the Buildkite Documentation for help with setting up Buildkite.
-
Buildkite is configured to report build statuses to GitHub.
-
The Mergify GitHub App is installed in your repository.
Using Buildkite Status Checks in Mergify Configuration
Section titled Using Buildkite Status Checks in Mergify ConfigurationOnce Buildkite reports status checks to GitHub, they can be used as conditions in your Mergify rules.
Here’s a simple example:
pull_request_rules:
- name: Automatically merge when Buildkite build succeeds
conditions:
- check-success = buildkite/github-test # Change this to match your Buildkite 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 Buildkite build.
Further Configuration
Section titled Further ConfigurationThe possibilities of integrating Buildkite with Mergify are extensive. For instance, you could use Mergify to:
-
Automatically update a PR when a build fails;
-
Apply labels, request reviewers, or post comments based on the results of status checks.
We encourage you to explore Mergify’s conditions and actions to create your personalized workflow.