View as Markdown

Edit

Convert a pull request to or from a draft.


The edit action lets Mergify change a pull request’s draft state. This is helpful when you want to automatically convert a pull request to or from a draft based on its conditions.

bot_accountBot account or null·defaultnull#

Mergify can impersonate a GitHub user to edit a pull request. If no bot_account is set, Mergify will edit the pull request itself. The user account needs write access to the repository, unless it is the author of the pull request.

draftboolean or null·defaultnull#

If the pull request should be a draft (true) or the other way around (false).

Converting a pull request to a draft on check failure

Section titled Converting a pull request to a draft on check failure

If any of your continuous integration checks fail, it might be worth converting the pull request to a draft automatically since it’s likely that it’s not ready for review.

pull_request_rules:
- name: convert to draft
conditions:
- "#check-failure > 0"
actions:
edit:
draft: true

Was this page helpful?