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

The `close` action allows Mergify to automatically close pull requests when
the specified conditions are met. This can be particularly useful when you
want to ensure that certain types of pull requests are not merged.

## Parameters

| Key name | Value type | Default | Description |
| --- | --- | --- | --- |
| `message` | simple-template | `"This pull request has been automatically closed by Mergify."` | A string with `{{ variable }}` placeholders. Allowed variables: `approvers`, `assignees`, `author`, `base`, `body`, `head`, `labels`, `number`, `queue_dequeue_reason`, `title`. |

## Examples

### Automatically close pull requests touching a file

If you want to automatically close any pull request that touches a certain
file, let's say `do_not_touch.txt`, you could write a rule such as:

```yaml
pull_request_rules:
  - name: disallow changing a file
    conditions:
      - files = do_not_touch.txt
    actions:
      close:
        message: No PR can touch this file.
```
