GitLab CI/CD offers a seamless integration and delivery system, allowing developers to automate several tasks of the development process. Mergify can interact with GitLab CI when the latter reports as a CI to the GitHub Checks API. This connection paves the way for strong automation processes that depend on the results of your GitLab CI jobs.
PrerequisitesSection titled Prerequisites
Before you can exploit the capabilities of Mergify with GitLab CI, you should ensure:
GitLab CI is correctly set up, and it’s running your project’s pipelines. Refer to the GitLab CI/CD Documentation for assistance with its setup.
GitLab CI is configured to report pipeline statuses to GitHub.
You have the Mergify GitHub App integrated into your repository.
Utilizing GitLab CI Status Checks with MergifySection titled Utilizing GitLab CI Status Checks with Mergify
Once GitLab CI forwards status checks to GitHub, they can be employed as conditions within your Mergify rules.
An illustrative example would be:
In the given scenario, Mergify will merge pull requests automatically if they possess at least one approved review and the GitLab CI build is successful.
Additional ConfigurationSection titled Additional Configuration
The potential of merging GitLab CI with Mergify is vast. As an example, Mergify could be tailored to:
Automatically update a PR when a build fails;