View as Markdown

Post Check (Deprecated)

Create a check-run on a pull request. Deprecated in favor of Merge Protections.


Migrating to Merge Protections

Section titled Migrating to Merge Protections

Merge Protections replace post_check by letting you define success_conditions directly, without creating an intermediate check-run.

pull_request_rules:
- name: Check CI status
conditions:
- base=main
actions:
post_check:
success_conditions:
- check-success=ci/test
neutral_conditions:
- check-neutral=ci/lint
title: "Mergify check: {{ check_rule_name }}"
summary: |
{{ check_conditions }}
merge_protections:
- name: Check CI status
if:
- base=main
success_conditions:
- check-success=ci/test
- check-neutral=ci/lint

The post_check action allows Mergify to create a check-run on a pull request. This can be useful in situations where you want to add a custom check to the status of a pull request based on Mergify’s evaluation.

Key nameValue typeDefault
neutral_conditions

List of conditions

or null
null

List of conditions to match to mark the pull request check as neutral, otherwise, it will be marked as failing.

success_conditions

List of conditions

or null
null

List of conditions to match to mark the pull request check as succeeded, otherwise, it will be marked as failing. If unset, the conditions from the rule that triggers this action are used.

summarytemplate
"{{ check_conditions }}"

The summary of the check.

titletemplate
"'{{ check_rule_name }}'{% if check_status == 'success' %} succeeded{% elif check_status == 'failure' %} failed{% endif %}"

The title of the check.

As the title and summary are templates, you can benefit from any pull request attributes, e.g. {{author}}, and also these additional variables:

  • {{ check_rule_name }} the name of the rule that triggered this action;

  • {{ check_succeed }} is true if all the conditions match, false otherwise;

  • {{ check_conditions }} the list of all conditions with a checkbox marked if the condition matches.

Was this page helpful?