Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/content/docs/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ mergify --token your_token_here <command>
| `mergify stack` | Create and manage stacked pull requests | [Stacks](/stacks) |
| `mergify freeze` | Schedule and manage merge freezes | [Scheduling Freezes](/merge-protections/freeze) |
| `mergify queue` | Monitor merge queue status | [Monitoring](/merge-queue/monitoring) |
| `mergify config` | Validate and simulate config | [Config](/configuration/file-format#validating-with-the-cli) |
| `mergify ci` | Upload and analyze CI results | [CI Insights](/ci-insights) |
28 changes: 28 additions & 0 deletions src/content/docs/configuration/file-format.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,31 @@ file, consider the following troubleshooting steps:
By following these troubleshooting steps, you can effectively identify and
resolve any issues with your Mergify configuration file, ensuring a smooth and
efficient automation process for your repository.

## Validating with the CLI

The [Mergify CLI](/cli) can check your configuration file locally before you
push, catching errors without waiting for a round-trip to GitHub.

### Validate

Check your configuration against the Mergify schema:

```bash
mergify config validate
```

This catches syntax errors, invalid keys, and type mismatches. It reads
`.mergify.yml`, `.mergify/config.yml`, or `.github/mergify.yml` from the
current directory.

### Simulate

Test your rules against an existing pull request without applying any actions:

```bash
mergify config simulate https://github.com/owner/repo/pull/142
```

Shows which rules would match and what actions Mergify would take. Useful for
testing rule changes before merging your configuration update.
Loading