comment ๐Ÿ”—

The comment action posts a comment to the pull request.

Options ๐Ÿ”—

Key Name

Value Type

Default

Value Description

message

Template

The message to write as a comment.

bot_account

Template

Mergify can impersonate a GitHub user to comment a pull request. If no bot_account is set, Mergify will comment the pull request itself.

Examples ๐Ÿ”—

๐Ÿคœ Request for Action ๐Ÿ”—

If any event that requires the author of the pull request to edit its pull request happen, you could write a rule that says something about it.

pull_request_rules:
  - name: ask to resolve conflict
    conditions:
      - conflict
    actions:
        comment:
          message: This pull request is now in conflicts. Could you fix it @{{author}}? ๐Ÿ™

The same goes if one of your check fails. It might be good to give a few hints to your contributor:

pull_request_rules:
  - name: ask to fix commit message
    conditions:
      - check-failure=Semantic Pull Request
      - -closed
    actions:
        comment:
          message: |
            Title does not follow the guidelines of [Conventional Commits](https://www.conventionalcommits.org).
            Please adjust title before merge.

๐Ÿ’Œ Welcoming your Contributors ๐Ÿ”—

When somebody that's not part of your team creates a pull requests, it might be great to give him a few hints about what to expect next. You could write him a little message.

pull_request_rules:
  - name: say hi to contributors if they are not part of the regularcontributors team
    conditions:
      - author!=@regularcontributors
    actions:
        comment:
          message: |
              Welcome to our great project!
              We're delighted to have you onboard ๐Ÿ’˜

๐Ÿ’ฌ Running CI pipelines automatically ๐Ÿ”—

Some continuous integration systems allow you to trigger jobs by commenting on the pull request. For example, Microsoft Azure allows that using the /AzurePipelines command. You could automate this using Mergify, and for example trigger the job after other CI jobs have passed and at least one developer has reviewed the pull request.

pull_request_rules:
  - name: run Azure CI job once ready to merge
    conditions:
      - "#approved-reviews-by>=1"
      - "check-success=ci/circleci: my_testing_job"
      - -closed
    actions:
      comments:
        message: /AzurePipelines run mypipeline