---
title: Comment
description: Comment a pull request.
---

The `comment` action allows Mergify to post a comment on your pull request when
certain conditions are met.

The comment action is a powerful tool that can provide automated responses to
various events in your pull request workflow. By customizing the conditions and
the message, you can create a more interactive and responsive experience for
your contributors.

## Parameters

| Key name | Value type | Default | Description |
| --- | --- | --- | --- |
| `bot_account` | template or null | `null` | Mergify can impersonate a GitHub user to comment a pull request. If no `bot_account` is set, Mergify will comment the pull request itself. |
| `message` | template or null | `null` | The message to write as a comment. |

## Examples

### Needs Review

In this example, Mergify will post the message "Thank you for your
contribution! A reviewer will be assigned soon." when a pull request is labeled
with "needs review".

```yaml
pull_request_rules:
  - name: comment when a pull request is labeled "needs review"
    conditions:
      - label = needs review
    actions:
      comment:
        message: Thank you for your contribution! A reviewer will be assigned soon.
```

### Warn of Conflicting Pull Requests

When a pull request is in conflict and cannot be merged, it's nice to be
notified automatically by Mergify. You can do this using this rule:

```yaml
pull_request_rules:
  - name: comment when a pull request is merged
    conditions:
      - conflict
    actions:
      comment:
        message: @{{author}} Your PR is in conflict and cannot be merged.
```

### Merge Thank You

In this example, Mergify will post the message "Thank you for your
contribution! Your pull request has been merged." when a pull request is
merged.

```yaml
pull_request_rules:
  - name: comment when a pull request is merged
    conditions:
      - merged
    actions:
      comment:
        message: Thank you for your contribution @{{author}}! Your pull request has been merged.
```
