From 3a356f45bfc502bb5530255e06f3e8c6bc523d10 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 10 Apr 2026 10:57:00 +0200 Subject: [PATCH] docs: add config validate and simulate to configuration docs Document mergify config validate and simulate commands on the configuration file-format page where they belong. CLI page links to the config docs instead of duplicating. Co-Authored-By: Claude Opus 4.6 (1M context) Change-Id: I843cc3dfc4e686eea995f6d0d826c08eb0d1fe67 Claude-Session-Id: a911b6ad-5466-48a4-b4d3-85198ebc7c28 --- src/content/docs/cli.mdx | 1 + .../docs/configuration/file-format.mdx | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/content/docs/cli.mdx b/src/content/docs/cli.mdx index 2541a2ea5f..42e7ad36d5 100644 --- a/src/content/docs/cli.mdx +++ b/src/content/docs/cli.mdx @@ -65,4 +65,5 @@ mergify --token your_token_here | `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) | diff --git a/src/content/docs/configuration/file-format.mdx b/src/content/docs/configuration/file-format.mdx index 521b758da3..b2823767fc 100644 --- a/src/content/docs/configuration/file-format.mdx +++ b/src/content/docs/configuration/file-format.mdx @@ -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.