comment๐
The comment
action posts a comment to the pull request.
Options๐
Key Name |
Value Type |
Default |
Value Description |
---|---|---|---|
|
Mergify can impersonate a GitHub user to comment a pull request.
If no |
||
|
The message to write as a comment. |
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:
- [email protected]
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