label๐Ÿ”—

The label action can add or remove labels from a pull request.

Options๐Ÿ”—

Key Name

Value Type

Default

Value Description

add

list of string

[]

The list of labels to add.

remove

list of string

[]

The list of labels to remove.

remove_all

Boolean

false

Remove all labels from the pull request.

Examples๐Ÿ”—

๐Ÿ’ฅ Warn on Conflicts๐Ÿ”—

When browsing the list of pull request, GitHub does not give any indication on which pull requests might be in conflict. Mergify allows to do this easily by adding a label.

pull_request_rules:
  - name: warn on conflicts
    conditions:
      - conflict
    actions:
      comment:
        message: "@{{author}} this pull request is now in conflict ๐Ÿ˜ฉ"
      label:
        add:
          - conflict
  - name: remove conflict label if not needed
    conditions:
      - -conflict
    actions:
      label:
        remove:
          - conflict

Then, you pull request list will look like this on conflict:

../../_images/conflict-pr-list.png