Integrating GitHub Actions with Mergify
How to leverage GitHub Actions using Mergify.
GitHub Actions Integration with Mergify
GitHub Actions is a CI/CD platform provided by GitHub that helps you automate tasks within your software development life cycle. Mergify can interact seamlessly with GitHub Actions by evaluating the status checks that GitHub Actions reports to your repositories. This integration paves the way for powerful automation workflows that respond to the outcomes of your GitHub Actions runs.
Before leveraging Mergify's features with GitHub Actions, ensure the following:
You've set up GitHub Actions in your repository. If you're new to GitHub Actions, their official documentation provides comprehensive guides.
GitHub Actions is already configured to report job statuses to your pull requests.
The Mergify GitHub App is installed in your repository.
To harness the full power of Mergify and GitHub Actions, you can utilize status checks reported by GitHub Actions as conditions in your Mergify rules.
GitHub Actions works slightly differently. To match a status check when using GitHub Actions, only the job name is used (not the workflow name).
Based on the example above, to validate the listed jobs, use the following configuration:
pull_request_rules:- name: Automatically merge when GitHub Actions jobs succeedconditions:- check-success=changelog_sync- check-success=actionlint- check-success=docker-onpremise- check-success=docker-saas- check-success=docker-label- check-success=add-linear-author-as-revieweractions:merge:method: merge
With Mergify, it's also possible to trigger a GitHub Actions workflow directly.
This can be achieved by using the
github_actions action in your Mergify
The integration of GitHub Actions with Mergify offers extensive possibilities. You can:
Craft rules that depend on specific GitHub Actions job results.
Merge pull requests only after certain workflows complete successfully.
React to failures in GitHub Actions runs by adding comments, labels, or even requesting reviews.