# Table of Contents - [Mergify Documentation](#mergify-documentation) - [Applications](#applications) - [CI Insights](#ci-insights) - [Activity Log](#activity-log) - [API Reference](#api-reference) - [Merge Queue](#merge-queue) - [Products](#products) - [Rule Syntax](#rule-syntax) - [Pull Requests](#pull-requests) - [Queues](#queues) - [Simulator](#simulator) - [Scheduled Freeze](#scheduled-freeze) - [Test Insights](#test-insights) - [Statistics](#statistics) - [API Usage](#api-usage) - [`batch_max_wait_time` defaults to 30s](#-batch-max-wait-time-defaults-to-30s) - [Browser Extensions](#browser-extensions) - [`strict` mode removed](#-strict-mode-removed) - [Mergify Billing System](#mergify-billing-system) - [Changelog](#changelog) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Mergify Changelog](#mergify-changelog) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) --- # Mergify Documentation Mergify Documentation Stop breaking main ====================== Mergify eliminates broken builds, tames flaky tests, and cuts CI waste, so your team ships with confidence. [Browse all products](https://docs.mergify.com/#products) ![Merge Queue dashboard showing a queue of pull requests being processed in parallel](https://docs.mergify.com/_astro/merge-queue-hero.DnjfHaL4_ZkrjDT.webp) 3-5× faster merge throughput 60-90% CI cost reduction 0 broken builds What problem are you solving? ----------------------------- [Broken main, slow merges\ \ PRs pass CI individually but fail when merged.\ \ Merge Queue →](https://docs.mergify.com/merge-queue) [Slow, expensive CI\ \ A single flaky job means rerunning the whole pipeline, and no one can see which jobs cost the most time and money.\ \ CI Insights →](https://docs.mergify.com/ci-insights) [Flaky tests blocking PRs\ \ Tests fail randomly, forcing reruns and eroding trust in CI.\ \ Test Insights →](https://docs.mergify.com/test-insights) Products -------- [### \ \ Merge Queue\ \ Parallel testing, batching, monorepo scopes, and priority rules.](https://docs.mergify.com/merge-queue) [### \ \ CI Insights\ \ Pipeline and job monitoring, flaky detection, and Auto-Retry.](https://docs.mergify.com/ci-insights) [### \ \ Test Insights\ \ Flaky test detection, quarantine, and test health tracking.](https://docs.mergify.com/test-insights) [### \ \ Merge Protections\ \ Advanced guardrails before code lands.](https://docs.mergify.com/merge-protections) [### \ \ Stacks\ \ Stacked PR workflow for incremental changes.](https://docs.mergify.com/stacks) [### \ \ Workflow Automation\ \ Rule engine and actions to automate PR workflows.](https://docs.mergify.com/workflow) Reference: [Configuration](https://docs.mergify.com/configuration/file-format) · [Conditions](https://docs.mergify.com/configuration/conditions) · [Commands](https://docs.mergify.com/commands) · [API](https://docs.mergify.com/api) · [Integrations](https://docs.mergify.com/integrations) Community --------- Share feedback, ask questions, and see what other teams build with Mergify. [](https://github.com/Mergifyio/mergify/discussions) [](https://www.youtube.com/@mergifyio) [](https://slack.mergify.com/) [](https://x.com/mergifyio) [](https://www.linkedin.com/company/mergify/) --- # Applications * * * Get current application [#](https://docs.mergify.com/api/applications/#application-application-get) ---------------------------------------------------------------------------------------------------- GET `/application` Get the current authenticated application Authorization (any one of) Admin Application Key CI Application Key Responses 200 Successful Response idstring required namestringrequired account\_scopeApplicationAccountScoperequired idintegerrequired loginstringrequired scope"admin" | "ci"required Enum: `admin` `ci` Example Response `{ "id": "e155518c-ca1b-443c-9be9-fe90fdab7345", "name": "an application name", "scope": "admin", "account_scope": { "id": 123456, "login": "Mergifyio" } }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/application" \ -H "Authorization: Bearer " Was this page helpful? Yes No Thanks for your feedback! --- # CI Insights * * * Get a single runner stat as a time series [#](https://docs.mergify.com/api/ci-insights/#ci-runner-stats) --------------------------------------------------------------------------------------------------------- GET `/ci/{owner}/runners/stats/{stat}` Return one of the runner stats bucketed over the requested time range, with a summary value over the full window. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `stat` "success\_rate" | "active\_runners" | "active\_jobs" | "utilization\_rate" | "avg\_duration" | "jobs\_per\_hour" | "avg\_jobs\_per\_hour" | "min\_duration" | "median\_duration" | "p95\_duration" | "p99\_duration" | "max\_duration" required `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ Query Parameters `runner_name` string\[\] The runner name to filter on `runner_name_exclude` string\[\] The runner name to exclude `runner_group_name` string\[\] The runner group name to filter on `runner_group_name_exclude` string\[\] The runner group name to exclude `runner_labels` string\[\] The runner labels to filter on (all must match) `start` string Start of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`end - 1 day\` when omitted; a paginated response carries the resolved value in its \`Link\` header. `end` string End of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`start + 1 day\` when only start is provided, or \`now\` otherwise; a paginated response carries the resolved value in its \`Link\` header. Responses 200 Successful Response Discriminated by `stat` — 12 types `avg_duration`RunnerDurationStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"avg\_duration" | "min\_duration" | "median\_duration" | "p95\_duration" | "p99\_duration" | "max\_duration"required Enum: `avg_duration` `min_duration` `median_duration` `p95_duration` `p99_duration` `max_duration` `min_duration`RunnerDurationStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"avg\_duration" | "min\_duration" | "median\_duration" | "p95\_duration" | "p99\_duration" | "max\_duration"required Enum: `avg_duration` `min_duration` `median_duration` `p95_duration` `p99_duration` `max_duration` `median_duration`RunnerDurationStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"avg\_duration" | "min\_duration" | "median\_duration" | "p95\_duration" | "p99\_duration" | "max\_duration"required Enum: `avg_duration` `min_duration` `median_duration` `p95_duration` `p99_duration` `max_duration` `p95_duration`RunnerDurationStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"avg\_duration" | "min\_duration" | "median\_duration" | "p95\_duration" | "p99\_duration" | "max\_duration"required Enum: `avg_duration` `min_duration` `median_duration` `p95_duration` `p99_duration` `max_duration` `p99_duration`RunnerDurationStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"avg\_duration" | "min\_duration" | "median\_duration" | "p95\_duration" | "p99\_duration" | "max\_duration"required Enum: `avg_duration` `min_duration` `median_duration` `p95_duration` `p99_duration` `max_duration` `max_duration`RunnerDurationStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"avg\_duration" | "min\_duration" | "median\_duration" | "p95\_duration" | "p99\_duration" | "max\_duration"required Enum: `avg_duration` `min_duration` `median_duration` `p95_duration` `p99_duration` `max_duration` `success_rate`RunnerRateStatsResponse valuenumber | nullrequired value\_over\_time\_RunnerStatsBucket\_float\_\[\]required startstring required endstring required valuenumber | nullrequired stat"success\_rate" | "jobs\_per\_hour" | "avg\_jobs\_per\_hour" | "utilization\_rate"required Enum: `success_rate` `jobs_per_hour` `avg_jobs_per_hour` `utilization_rate` `jobs_per_hour`RunnerRateStatsResponse valuenumber | nullrequired value\_over\_time\_RunnerStatsBucket\_float\_\[\]required startstring required endstring required valuenumber | nullrequired stat"success\_rate" | "jobs\_per\_hour" | "avg\_jobs\_per\_hour" | "utilization\_rate"required Enum: `success_rate` `jobs_per_hour` `avg_jobs_per_hour` `utilization_rate` `avg_jobs_per_hour`RunnerRateStatsResponse valuenumber | nullrequired value\_over\_time\_RunnerStatsBucket\_float\_\[\]required startstring required endstring required valuenumber | nullrequired stat"success\_rate" | "jobs\_per\_hour" | "avg\_jobs\_per\_hour" | "utilization\_rate"required Enum: `success_rate` `jobs_per_hour` `avg_jobs_per_hour` `utilization_rate` `utilization_rate`RunnerRateStatsResponse valuenumber | nullrequired value\_over\_time\_RunnerStatsBucket\_float\_\[\]required startstring required endstring required valuenumber | nullrequired stat"success\_rate" | "jobs\_per\_hour" | "avg\_jobs\_per\_hour" | "utilization\_rate"required Enum: `success_rate` `jobs_per_hour` `avg_jobs_per_hour` `utilization_rate` `active_runners`RunnerCountStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"active\_runners" | "active\_jobs"required Enum: `active_runners` `active_jobs` `active_jobs`RunnerCountStatsResponse valueinteger | nullrequired value\_over\_time\_RunnerStatsBucket\_int\_\[\]required startstring required endstring required valueinteger | nullrequired stat"active\_runners" | "active\_jobs"required Enum: `active_runners` `active_jobs` Example Response `{ "value": 0, "value_over_time": [ { "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "value": 0 } ], "stat": "avg_duration" }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/runners/stats/:stat" \ -H "Authorization: Bearer " Get a single CI queue stat as a time series [#](https://docs.mergify.com/api/ci-insights/#ci-queue-stats) ---------------------------------------------------------------------------------------------------------- GET `/ci/{owner}/queue/stats/{stat}` Return one of the CI queue stats bucketed over the requested time range, with a summary value over the full window. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `stat` "total\_jobs" | "avg\_wait\_time" | "min\_wait\_time" | "median\_wait\_time" | "p95\_wait\_time" | "p99\_wait\_time" | "max\_wait\_time" required `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ Query Parameters `labels` string\[\] The labels to filter on (all must match) `start` string Start of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`end - 1 day\` when omitted; a paginated response carries the resolved value in its \`Link\` header. `end` string End of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`start + 1 day\` when only start is provided, or \`now\` otherwise; a paginated response carries the resolved value in its \`Link\` header. Responses 200 Successful Response stat"total\_jobs" | "avg\_wait\_time" | "min\_wait\_time" | "median\_wait\_time" | "p95\_wait\_time" | "p99\_wait\_time" | "max\_wait\_time"required Enum: `total_jobs` `avg_wait_time` `min_wait_time` `median_wait_time` `p95_wait_time` `p99_wait_time` `max_wait_time` valueinteger | nullrequired value\_over\_time\_QueueStatsBucket\[\]required startstring required endstring required valueinteger | nullrequired Example Response `{ "stat": "total_jobs", "value": 0, "value_over_time": [ { "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "value": 0 } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/queue/stats/:stat" \ -H "Authorization: Bearer " Was this page helpful? Yes No Thanks for your feedback! --- # Activity Log * * * Get the activity log [#](https://docs.mergify.com/api/activity-log/#get-repository-events-repos-owner-repository-logs-get) --------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/logs` Get the activity log of the requested repository. Supports filtering by \`event\_type\`, derived \`outcome\` (\`success\` / \`failure\` / \`pending\` / \`neutral\`), \`trigger\` (include only these trigger strings — Datadog \`Only\`), and \`not\_trigger\` (exclude). \`trigger\` and \`not\_trigger\` are mutually exclusive. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `pull_request` integer\[\] Filter events by pull-request number. Repeatable to match several PRs at once (e.g. \`?pull\_request=1&pull\_request=2\`). `base_ref` string Get events for PRs to the given base ref min length: 1 · max length: 255 `batch_pull` integer\[\] Filter to batch (draft) pull requests' own lifecycle events by number (surfaced in the dashboard as "Batch Pull Request"). Repeatable to match several batches at once. The draft PR is the Mergify-opened pull request that speculatively checks a batch; this returns each batch's \`action.queue.checks\_start\` / \`action.queue.checks\_end\` events (which snapshot the draft PR number) plus the batch's bisection events. When \`in\_place\` is true the number is the user's own PR rather than a Mergify draft. The number rotates on checks-retry — each event snapshots the number at that attempt. Mutually exclusive with \`not\_batch\_pull\` (exclusion). `not_batch_pull` integer\[\] Exclude batch (draft) pull requests' own lifecycle events by number — the same event set \`batch\_pull\` includes, negated. Repeatable. Mirrors Datadog's facet semantics: unchecking a batch pull request in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with \`batch\_pull\` (positive include). `event_type` ("action.assign" | "action.backport" | "action.close" | "action.comment" | "action.copy" | "action.delete\_head\_branch" | "action.dequeue" | "action.dismiss\_reviews" | "action.edit" | "action.github\_actions" | "action.label" | "action.label.loop\_stopped" | "action.merge" | "action.post\_check" | "action.queue.batch\_bisection\_end" | "action.queue.batch\_bisection\_start" | "action.queue.change" | "action.queue.checks.change" | "action.queue.checks\_end" | "action.queue.checks\_postponed" | "action.queue.checks\_start" | "action.queue.conflict\_deferred" | "action.queue.enter" | "action.queue.leave" | "action.queue.merged" | "action.rebase" | "action.refresh" | "action.request\_reviews" | "action.review" | "action.squash" | "action.update" | "ci\_insights.auto\_quarantine.disabled" | "ci\_insights.auto\_quarantine.enabled" | "ci\_insights.auto\_quarantine.modified" | "ci\_insights.job\_retried" | "command.dequeue" | "command.queue" | "product.disabled" | "product.enabled" | "queue.pause.create" | "queue.pause.delete" | "queue.pause.update" | "scheduled\_freeze.create" | "scheduled\_freeze.delete" | "scheduled\_freeze.update" | "test.dequarantined" | "test.quarantined")\[\] The specific types of events to select. \`action.queue.checks\_not\_started\` is accepted as a deprecated alias of \`action.queue.checks\_postponed\`. `not_event_type` ("action.assign" | "action.backport" | "action.close" | "action.comment" | "action.copy" | "action.delete\_head\_branch" | "action.dequeue" | "action.dismiss\_reviews" | "action.edit" | "action.github\_actions" | "action.label" | "action.label.loop\_stopped" | "action.merge" | "action.post\_check" | "action.queue.batch\_bisection\_end" | "action.queue.batch\_bisection\_start" | "action.queue.change" | "action.queue.checks.change" | "action.queue.checks\_end" | "action.queue.checks\_postponed" | "action.queue.checks\_start" | "action.queue.conflict\_deferred" | "action.queue.enter" | "action.queue.leave" | "action.queue.merged" | "action.rebase" | "action.refresh" | "action.request\_reviews" | "action.review" | "action.squash" | "action.update" | "ci\_insights.auto\_quarantine.disabled" | "ci\_insights.auto\_quarantine.enabled" | "ci\_insights.auto\_quarantine.modified" | "ci\_insights.job\_retried" | "command.dequeue" | "command.queue" | "product.disabled" | "product.enabled" | "queue.pause.create" | "queue.pause.delete" | "queue.pause.update" | "scheduled\_freeze.create" | "scheduled\_freeze.delete" | "scheduled\_freeze.update" | "test.dequarantined" | "test.quarantined")\[\] Exclude events whose type matches any of the given values. Mutually exclusive with \`event\_type\` (positive include). \`action.queue.checks\_not\_started\` is accepted as a deprecated alias of \`action.queue.checks\_postponed\`. `outcome` ("success" | "failure" | "pending" | "neutral")\[\] Filter events by derived outcome label (\`success\` / \`failure\` / \`pending\` / \`neutral\`). Repeatable to match several outcomes at once (e.g. \`?outcome=success&outcome=failure\`). `not_outcome` ("success" | "failure" | "pending" | "neutral")\[\] Exclude events whose derived outcome label matches any of the given values (\`success\` / \`failure\` / \`pending\` / \`neutral\`). Repeatable. Mirrors Datadog's facet semantics: unchecking an outcome in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with \`outcome\` (positive include). `trigger` string\[\] Include only events whose \`trigger\` matches one of the given values (exact match). Repeatable. Mirrors Datadog's facet behaviour after clicking \`Only\`: the URL switches from exclusion mode to inclusion mode with a positive list — shorter than \`not\_trigger=\`. Mutually exclusive with \`not\_trigger\`. `not_trigger` string\[\] Exclude events whose \`trigger\` matches any of the given values (exact match). Repeatable. Mirrors Datadog's facet semantics: the default state is \`all triggers included\`, and unchecking a trigger in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with \`trigger\` (positive include). `not_pull_request` integer\[\] Exclude events whose pull request matches any of the given numbers. Mutually exclusive with \`pull\_request\` (positive include). `received_from` string Start of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`received\_to - 1 day\`. `received_to` string End of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`now\`. `cursor` string The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages `per_page` integer The number of items per page min: 1 · max: 100 Responses 200 Successful Response sizeintegerrequired The number of items in this page per\_pageintegerrequired The number of items per page eventsobject (47 types)\[\]required The list of events Discriminated by `type` — 47 types `action.assign`EventAssign idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventAssignMetadatarequired addedstring\[\]required removedstring\[\]required `action.backport`EventBackport idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCopyMetadatarequired tostringrequired pull\_request\_numberintegerrequired conflictsbooleanrequired `action.close`EventClose idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCloseMetadatarequired messagestringrequired `action.comment`EventComment idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCommentMetadatarequired messagestringrequired `action.copy`EventCopy idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCopyMetadatarequired tostringrequired pull\_request\_numberintegerrequired conflictsbooleanrequired `action.delete_head_branch`EventDeleteHeadBranch idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventDeleteHeadBranchMetadatarequired branchstringrequired `action.dequeue`EventDequeue idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` metadataEventNoMetadatarequired typestringrequired `action.dismiss_reviews`EventDismissReviews idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventDismissReviewsMetadatarequired usersstring\[\]required `action.edit`EventEdit idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventEditMetadatarequired draftbooleanrequired `action.github_actions`EventGithubActions idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventGithubActionsMetadatarequired workflowstringrequired inputsobjectrequired `action.label`EventLabel idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventLabelMetadatarequired addedstring\[\]required removedstring\[\]required `action.label.loop_stopped`EventLabelLoopStopped idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventLabelLoopStoppedMetadatarequired labelstringrequired The label Mergify stopped adding and removing on the pull request. rulesstring\[\]required The pull request rules that kept adding and removing the label, undoing each other. `action.merge`EventMerge idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventMergeMetadatarequired branchstringrequired `action.post_check`EventPostCheck idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventPostCheckMetadatarequired conclusion"success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed\_out" | "action\_required" | "stale" | "startup\_failure" | nullrequired titlestringrequired summarystringrequired `action.queue.batch_bisection_end`EventQueueBatchBisectionEnd idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueBatchBisectionEndMetadatarequired queue\_namestringrequired priority\_rule\_namestring | nullrequired original\_batch\_pr\_numbersinteger\[\]required culprit\_foundbooleanrequired culprit\_pr\_numbersinteger\[\]required confirmed\_culprit\_pr\_numbersinteger\[\] | nullrequired dropped\_unverified\_pr\_numbersinteger\[\] | nullrequired remaining\_pr\_numbersinteger\[\]required max\_failure\_resolution\_reachedbooleanrequired session\_idstring required batch\_idstring | nullrequired The batch this event concerns. Correlate the queue events for a batch (checks\_start / checks\_end / leave / bisection) on this id. Null on events persisted before this field was added. train\_car\_idstring | nullrequired Deprecated: use \`batch\_id\` instead (same value). batch\_namestring | nullrequired The display name of the batch this event concerns, the same name the merge queue shows while the batch is queued. Recorded on the event because the name lives only in the live queue state and is unrecoverable once the batch leaves the queue. Null on events persisted before this field was added. `action.queue.batch_bisection_start`EventQueueBatchBisectionStart idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueBatchBisectionStartMetadatarequired queue\_namestringrequired priority\_rule\_namestring | nullrequired original\_batch\_pr\_numbersinteger\[\]required batch\_size\_before\_splitintegerrequired number\_of\_sub\_batchesintegerrequired bisection\_depthintegerrequired is\_top\_levelbooleanrequired session\_idstring required batch\_idstring | nullrequired The batch this event concerns. Correlate the queue events for a batch (checks\_start / checks\_end / leave / bisection) on this id. Null on events persisted before this field was added. train\_car\_idstring | nullrequired Deprecated: use \`batch\_id\` instead (same value). batch\_namestring | nullrequired The display name of the batch this event concerns, the same name the merge queue shows while the batch is queued. Recorded on the event because the name lives only in the live queue state and is unrecoverable once the batch leaves the queue. Null on events persisted before this field was added. `action.queue.change`EventQueueChange idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueChangeMetadatarequired queue\_namestringrequired priority\_rule\_namestring | nullrequired sizeintegerrequired `action.queue.checks.change`EventQueueChecksChange idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueChecksChangeMetadatarequired queue\_namestringrequired running\_checksintegerrequired `action.queue.checks_end`EventQueueChecksEnd idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueChecksEndMetadatarequired abortedbooleanrequired abort\_code"PR\_DEQUEUED" | "PR\_DEQUEUED\_FROM\_PARTITION" | "PR\_AHEAD\_DEQUEUED" | "BATCH\_AHEAD\_FAILED" | "PR\_WITH\_HIGHER\_PRIORITY\_QUEUED" | "SCHEDULED\_FREEZE\_STATUS\_CHANGED" | "SPECULATIVE\_CHECK\_NUMBER\_REDUCED" | "CHECKS\_TIMEOUT" | "CHECKS\_FAILED" | "DROPPED\_BY\_BISECTION\_ELIMINATION" | "QUEUE\_RULE\_MISSING" | "BASE\_BRANCH\_MISSING" | "BASE\_BRANCH\_CHANGED" | "PR\_UNEXPECTEDLY\_FAILED\_TO\_MERGE" | "BATCH\_MAX\_FAILURE\_RESOLUTION\_ATTEMPTS" | "PR\_CHECKS\_STOPPED\_BECAUSE\_MERGE\_QUEUE\_PAUSE" | "CONFLICT\_WITH\_BASE\_BRANCH" | "CONFLICT\_WITH\_PULL\_AHEAD" | "BRANCH\_UPDATE\_FAILED" | "DRAFT\_PULL\_REQUEST\_CHANGED" | "BATCH\_PULL\_REQUEST\_CLOSED" | "PULL\_REQUEST\_UPDATED" | "MERGE\_QUEUE\_RESET" | "INCOMPATIBILITY\_WITH\_BRANCH\_PROTECTIONS" | "PR\_MANUALLY\_MERGED" | "DRAFT\_PULL\_REQUEST\_CREATION\_FAILED" | "DRAFT\_PULL\_REQUEST\_CREATION\_BRANCH\_NOT\_INDEXED" | "CONFIGURATION\_CHANGED" | "UNPROCESSABLE\_PULL\_REQUEST" | "PR\_MANUALLY\_DEQUEUED" | "STACK\_PREDECESSOR\_DEQUEUED" | "INTERMEDIATE\_RESULTS\_SKIPPED" | "CHECKS\_RETRIED" | "SCHEDULE\_BLOCKED\_AHEAD\_YIELDED" | "BASE\_REF\_ALIGNMENT\_TIMEOUT" | "GITHUB\_STACKED\_PULL\_REQUEST\_MERGE\_UNSUPPORTED" | "BATCH\_SCOPES\_CHANGED" | "BATCH\_AHEAD\_BRANCH\_EDITED" | "CHECKS\_INTERRUPTED" | "GITHUB\_WORKFLOWS\_PERMISSION\_MISSING" | nullrequired abort\_reasonstring | nullrequired abort\_status"DEFINITIVE" | "REEMBARKED"required Enum: `DEFINITIVE` `REEMBARKED` branchstringrequired priority\_rule\_namestring | nullrequired queue\_namestringrequired queued\_atstring required retry\_attemptinteger | nullrequired max\_retriesinteger | nullrequired retries\_before\_runinteger | null How many checks retries preceded this run: 0 for a first attempt, 1 or more for a rerun after a failure (whose duration is a repeat attempt, not a nominal run). Distinct from \`retry\_attempt\`, which concerns the retry abort event. Null on events persisted before this field existed. bisection\_depthinteger | null How many splits of a failing batch this batch descends from: 0 for a batch checked as it was embarked, 1 or more for a sub-batch created while bisecting a failing batch (its run checks a reduced batch). Null on events persisted before this field existed. speculative\_check\_pull\_requestSignals\_SpeculativeCheckPullRequestrequired numberintegerrequired in\_placebooleanrequired checks\_timed\_outbooleanrequired checks\_conclusion"success" | "failure" | "neutral" | "cancelled" | "skipped" | "stale" | "action\_required" | "timed\_out" | "error" | "pending"required Enum: `success` `failure` `neutral` `cancelled` `skipped` `stale` `action_required` `timed_out` `error` `pending` checks\_started\_atstring | nullrequired checks\_ended\_atstring | nullrequired unsuccessful\_checksQueueCheck\_Serialized\[\]required pull\_request\_numbersinteger\[\]required direct\_merge\_impacted\_base\_scopesstring\[\] | nullrequired The scopes the base branch moved in while this pull request was queued, when the merge skipped its queue CI run and trusted the pull request's own checks because none of those commits touch what it touches. Null when a check ran, when the pull request already contained the base tip and so had nothing to re-check, and on events persisted before this field existed. batch\_idstring | nullrequired The batch this event concerns. Correlate the queue events for a batch (checks\_start / checks\_end / leave / bisection) on this id. Null on events persisted before this field was added. train\_car\_idstring | nullrequired Deprecated: use \`batch\_id\` instead (same value). batch\_namestring | nullrequired The display name of the batch this event concerns, the same name the merge queue shows while the batch is queued. Recorded on the event because the name lives only in the live queue state and is unrecoverable once the batch leaves the queue. Null on events persisted before this field was added. scopesstring\[\] | nullrequired The scopes of the batch checking this pull request. Batches with disjoint scopes run their checks concurrently, so the scope tells which parallel lane the batch occupies. Empty when the queue is not scoped. Null on events persisted before this field was added. parent\_batch\_idsstring \[\] | nullrequired The batch ids this batch was queued behind, as of this event. A batch inherits its parents' check results, so this links it back to the ones checked before it. A parent may be dropped once its pull requests have merged, so a later event for the same batch can list fewer parents than an earlier one, or none at all. Empty on a first check with no predecessor. Null on events persisted before this field was added. session\_idstring required all\_scopesboolean | null Whether the train car checking this pull request impacts every scope (a merge-queue barrier). Null on events persisted before this field existed. `action.queue.checks_postponed`EventQueueChecksPostponed idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueChecksPostponedMetadatarequired branchstringrequired priority\_rule\_namestring | nullrequired queue\_namestringrequired queued\_atstring required reasonstringrequired session\_idstring required batch\_idstring | nullrequired The sub-batch this event concerns. Correlate the checks\_postponed events emitted for one failed sub-batch on this id. Null on events persisted before this field was added. batch\_namestring | nullrequired The display name of the batch this event concerns, the same name the merge queue shows while the batch is queued. Recorded on the event because the name lives only in the live queue state and is unrecoverable once the batch leaves the queue. Null on events persisted before this field was added. sub\_batch\_pr\_numbersinteger\[\] | nullrequired The pull request numbers of the whole failed sub-batch, so a collapsed row can name every affected pull request and not just the one this per-pull-request event carries. Null on events persisted before this field was added. attemptinteger | null 1-based number of this draft-creation failure within the pull request's current queue stay (\`metadata.session\_id\`): 1 on the first failure, incrementing on each automatic retry. Authoritative — it reflects every stored failure of the stay, independent of the requested time window or page, so a repeatedly-stuck pull request reads its true count. Null/absent on events that predate this field or when the count could not be derived. `action.queue.checks_start`EventQueueChecksStart idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueChecksStartMetadatarequired branchstringrequired priority\_rule\_namestring | nullrequired queue\_namestringrequired queued\_atstring required start\_reasonstringrequired speculative\_check\_pull\_requestSignals\_SpeculativeCheckPullRequestrequired numberintegerrequired in\_placebooleanrequired checks\_timed\_outbooleanrequired checks\_conclusion"success" | "failure" | "neutral" | "cancelled" | "skipped" | "stale" | "action\_required" | "timed\_out" | "error" | "pending"required Enum: `success` `failure` `neutral` `cancelled` `skipped` `stale` `action_required` `timed_out` `error` `pending` checks\_started\_atstring | nullrequired checks\_ended\_atstring | nullrequired unsuccessful\_checksQueueCheck\_Serialized\[\]required pull\_request\_numbersinteger\[\]required direct\_merge\_impacted\_base\_scopesstring\[\] | nullrequired The scopes the base branch moved in while this pull request was queued, when the merge skipped its queue CI run and trusted the pull request's own checks because none of those commits touch what it touches. Null when a check ran, when the pull request already contained the base tip and so had nothing to re-check, and on events persisted before this field existed. batch\_idstring | nullrequired The batch this event concerns. Correlate the queue events for a batch (checks\_start / checks\_end / leave / bisection) on this id. Null on events persisted before this field was added. train\_car\_idstring | nullrequired Deprecated: use \`batch\_id\` instead (same value). batch\_namestring | nullrequired The display name of the batch this event concerns, the same name the merge queue shows while the batch is queued. Recorded on the event because the name lives only in the live queue state and is unrecoverable once the batch leaves the queue. Null on events persisted before this field was added. scopesstring\[\] | nullrequired The scopes of the batch checking this pull request. Batches with disjoint scopes run their checks concurrently, so the scope tells which parallel lane the batch occupies. Empty when the queue is not scoped. Null on events persisted before this field was added. parent\_batch\_idsstring \[\] | nullrequired The batch ids this batch was queued behind, as of this event. A batch inherits its parents' check results, so this links it back to the ones checked before it. A parent may be dropped once its pull requests have merged, so a later event for the same batch can list fewer parents than an earlier one, or none at all. Empty on a first check with no predecessor. Null on events persisted before this field was added. previous\_batch\_idstring | nullrequired The ID of the batch checked just before this one for the same pull request, when this check is a restart. Null on the first check. previous\_batch\_namestring | nullrequired The display name of \`previous\_batch\_id\`'s batch, read back from that batch's own checks\_end event. Null on the first check, and when the predecessor was checked before \`batch\_name\` was recorded on events. session\_idstring required all\_scopesboolean | null Whether the train car checking this pull request impacts every scope (a merge-queue barrier). Null on events persisted before this field existed. `action.queue.conflict_deferred`EventQueueConflictDeferred idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueConflictDeferredMetadatarequired branchstringrequired priority\_rule\_namestring | nullrequired queue\_namestringrequired queued\_atstring required reasonstringrequired session\_idstring required blocking\_pull\_request\_numbersinteger\[\]required The pull requests ahead in the queue that were in flight when the merge failed. The conflicting hunk belongs to at least one of them; the queue never learns which, so \`reason\` claims a conflict with the set rather than with a named pull request. `action.queue.enter`EventQueueEnter idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueEnterMetadatarequired queue\_namestringrequired branchstringrequired queued\_atstring required priority\_rule\_namestring | nullrequired session\_idstring required `action.queue.leave`EventQueueLeave idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueLeaveMetadatarequired reasonstringrequired mergedbooleanrequired queue\_namestringrequired branchstringrequired queued\_atstring required seconds\_waiting\_for\_scheduleintegerrequired seconds\_waiting\_for\_freezeintegerrequired priority\_rule\_namestring | nullrequired conditions\_evaluationQueueConditionEvaluationResult\_Serialized | nullrequired matchbooleanrequired labelstringrequired is\_label\_user\_inputbooleanrequired descriptionstring | nullrequired attribute\_namestring | nullrequired operatorstring | nullrequired scheduleobject | nullrequired subconditionsQueueConditionEvaluationResult\_Serialized\[\]required evaluationsQueueConditionEvaluationResult\_Evaluation\_Serialized\[\]required checksQueueCheck\_Serialized\[\]required namestringrequired descriptionstringrequired urlstring | nullrequired details\_urlstring | null state"failure" | "error" | "cancelled" | "action\_required" | "timed\_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required Enum: `failure` `error` `cancelled` `action_required` `timed_out` `pending` `neutral` `skipped` `stale` `success` avatar\_urlstring | nullrequired unsuccessful\_checksQueueCheck\_Serialized\[\]required namestringrequired descriptionstringrequired urlstring | nullrequired details\_urlstring | null state"failure" | "error" | "cancelled" | "action\_required" | "timed\_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required Enum: `failure` `error` `cancelled` `action_required` `timed_out` `pending` `neutral` `skipped` `stale` `success` avatar\_urlstring | nullrequired pull\_request\_head\_shastringrequired session\_idstring | nullrequired dequeue\_code"PR\_MERGED" | "PR\_MERGED\_INTERMEDIATE\_RESULTS\_SKIPPED" | "PR\_DEQUEUED" | "PR\_DEQUEUED\_FROM\_PARTITION" | "PR\_AHEAD\_DEQUEUED" | "BATCH\_AHEAD\_FAILED" | "PR\_WITH\_HIGHER\_PRIORITY\_QUEUED" | "SCHEDULED\_FREEZE\_STATUS\_CHANGED" | "SPECULATIVE\_CHECK\_NUMBER\_REDUCED" | "CHECKS\_TIMEOUT" | "CHECKS\_FAILED" | "DROPPED\_BY\_BISECTION\_ELIMINATION" | "QUEUE\_RULE\_MISSING" | "BASE\_BRANCH\_MISSING" | "BASE\_BRANCH\_CHANGED" | "PR\_UNEXPECTEDLY\_FAILED\_TO\_MERGE" | "BATCH\_MAX\_FAILURE\_RESOLUTION\_ATTEMPTS" | "PR\_CHECKS\_STOPPED\_BECAUSE\_MERGE\_QUEUE\_PAUSE" | "CONFLICT\_WITH\_BASE\_BRANCH" | "CONFLICT\_WITH\_PULL\_AHEAD" | "BRANCH\_UPDATE\_FAILED" | "DRAFT\_PULL\_REQUEST\_CHANGED" | "BATCH\_PULL\_REQUEST\_CLOSED" | "PULL\_REQUEST\_UPDATED" | "MERGE\_QUEUE\_RESET" | "INCOMPATIBILITY\_WITH\_BRANCH\_PROTECTIONS" | "PR\_MANUALLY\_MERGED" | "DRAFT\_PULL\_REQUEST\_CREATION\_FAILED" | "DRAFT\_PULL\_REQUEST\_CREATION\_BRANCH\_NOT\_INDEXED" | "CONFIGURATION\_CHANGED" | "UNPROCESSABLE\_PULL\_REQUEST" | "PR\_MANUALLY\_DEQUEUED" | "STACK\_PREDECESSOR\_DEQUEUED" | "INTERMEDIATE\_RESULTS\_SKIPPED" | "CHECKS\_RETRIED" | "SCHEDULE\_BLOCKED\_AHEAD\_YIELDED" | "BASE\_REF\_ALIGNMENT\_TIMEOUT" | "GITHUB\_STACKED\_PULL\_REQUEST\_MERGE\_UNSUPPORTED" | "BATCH\_SCOPES\_CHANGED" | "BATCH\_AHEAD\_BRANCH\_EDITED" | "CHECKS\_INTERRUPTED" | "GITHUB\_WORKFLOWS\_PERMISSION\_MISSING" | nullrequired batch\_idstring | nullrequired The batch the pull request was in when it left the queue. Use it to correlate this leave with the batch's checks\_start / checks\_end events. Null when the pull request left before being embarked in a batch, or on events persisted before this field was added. scopesstring\[\] | nullrequired The scopes of the batch the pull request was in when it left. Empty when the queue is not scoped. Null when the pull request left before being embarked in a batch, or on events persisted before this field was added. all\_scopesboolean | nullrequired Whether the train car the pull request was in impacted every scope (a merge-queue barrier). Null when the pull request left before being embarked in a car, or on events persisted before this field was added. `action.queue.merged`EventQueueMerged idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueueMergedMetadatarequired branchstringrequired queue\_namestringrequired queued\_atstring required priority\_rule\_namestring | nullrequired session\_idstring required merge\_commit\_shastring | nullrequired The commit this queue merge landed on the base branch (its new tip): a merge/squash commit, or the fast-forwarded head SHA for fast-forward merges. Null on events persisted before this field was added. `action.rebase`EventRebase idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` metadataEventNoMetadatarequired typestringrequired `action.refresh`EventRefresh idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` metadataEventNoMetadatarequired typestringrequired `action.request_reviews`EventRequestReviews idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventRequestReviewsMetadatarequired reviewersstring\[\]required team\_reviewersstring\[\]required `action.review`EventReview idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventReviewMetadatarequired review\_type"APPROVE" | "REQUEST\_CHANGES" | "COMMENT"required Enum: `APPROVE` `REQUEST_CHANGES` `COMMENT` reviewerstring | nullrequired messagestring | nullrequired `action.squash`EventSquash idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` metadataEventNoMetadatarequired typestringrequired `action.update`EventUpdate idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` metadataEventNoMetadatarequired typestringrequired `ci_insights.auto_quarantine.disabled`EventCiInsightsAutoQuarantineDisabled idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCiInsightsAutoQuarantineDisabledMetadatarequired disabled\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired disabled\_atstring required auto\_quarantine\_config\_attributesAutoQuarantineConfigEventLogAttributesrequired ignore\_broken\_on\_default\_branchbooleanrequired disabled\_by\_staffbooleanrequired `ci_insights.auto_quarantine.enabled`EventCiInsightsAutoQuarantineEnabled idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCiInsightsAutoQuarantineEnabledMetadatarequired enabled\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired enabled\_atstring required auto\_quarantine\_config\_attributesAutoQuarantineConfigEventLogAttributesrequired ignore\_broken\_on\_default\_branchbooleanrequired enabled\_by\_staffbooleanrequired `ci_insights.auto_quarantine.modified`EventCiInsightsAutoQuarantineModified idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCiInsightsAutoQuarantineModifiedMetadatarequired updated\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired updated\_atstring required auto\_quarantine\_config\_attributes\_beforeAutoQuarantineConfigEventLogAttributesrequired ignore\_broken\_on\_default\_branchbooleanrequired auto\_quarantine\_config\_attributes\_afterAutoQuarantineConfigEventLogAttributesrequired ignore\_broken\_on\_default\_branchbooleanrequired updated\_by\_staffbooleanrequired `ci_insights.job_retried`EventCiInsightsJobRetried idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCiInsightsJobRetriedMetadatarequired rule\_idstring required rule\_namestringrequired max\_retryintegerrequired retry\_mode"job" | "pipeline"required Enum: `job` `pipeline` retry\_attemptintegerrequired condition\_matches(SimpleConditionMatchSerialized | LogPatternAnnotationConditionMatchSerialized | LogPatternJobLogConditionMatchSerialized)\[\]required outcome"retried" | "skipped\_quota\_exceeded"required Enum: `retried` `skipped_quota_exceeded` workflow\_run\_idinteger | nullrequired job\_urlstring | nullrequired `command.dequeue`EventCommandDequeue idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCommandMetadatarequired authorGitHubAccountrequired loginstringrequired idintegerrequired type"User" | "Organization" | "Bot" | "Mannequin" | "Enterprise" | nullrequired avatar\_urlstring | null comment\_idintegerrequired session\_idstring | nullrequired command\_trigger"comment" | "checkbox" | nullrequired trigger\_comment\_urlstring | nullrequired `command.queue`EventCommandQueue idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventCommandMetadatarequired authorGitHubAccountrequired loginstringrequired idintegerrequired type"User" | "Organization" | "Bot" | "Mannequin" | "Enterprise" | nullrequired avatar\_urlstring | null comment\_idintegerrequired session\_idstring | nullrequired command\_trigger"comment" | "checkbox" | nullrequired trigger\_comment\_urlstring | nullrequired `product.disabled`EventProductDisabled idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventProductDisabledMetadatarequired product"ci\_insights" | "merge\_protections" | "workflow\_automation" | "merge\_queue"required Enum: `ci_insights` `merge_protections` `workflow_automation` `merge_queue` disabled\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired disabled\_atstring required disabled\_by\_staffbooleanrequired `product.enabled`EventProductEnabled idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventProductEnabledMetadatarequired product"ci\_insights" | "merge\_protections" | "workflow\_automation" | "merge\_queue"required Enum: `ci_insights` `merge_protections` `workflow_automation` `merge_queue` enabled\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired enabled\_atstring required enabled\_by\_staffbooleanrequired `queue.pause.create`EventQueuePauseCreate idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueuePauseCreateMetadatarequired reasonstringrequired created\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired created\_by\_staffbooleanrequired `queue.pause.delete`EventQueuePauseDelete idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueuePauseDeleteMetadatarequired deleted\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired deleted\_by\_staffbooleanrequired `queue.pause.update`EventQueuePauseUpdate idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventQueuePauseUpdateMetadatarequired reasonstringrequired updated\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired updated\_by\_staffbooleanrequired `scheduled_freeze.create`EventScheduledFreezeCreate idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventScheduledFreezeCreateMetadatarequired scheduled\_freeze\_attributesScheduledFreezeEventLogAttributesrequired reasonstringrequired startstring required endstring | nullrequired timezonestringrequired matching\_conditions(MatchingConditionsDict-Output | string)\[\]required exclude\_conditions(MatchingConditionsDict-Output | string)\[\]required created\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired created\_atstring required created\_by\_staffbooleanrequired `scheduled_freeze.delete`EventScheduledFreezeDelete idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventScheduledFreezeDeleteMetadatarequired scheduled\_freeze\_attributesScheduledFreezeEventLogAttributesrequired reasonstringrequired startstring required endstring | nullrequired timezonestringrequired matching\_conditions(MatchingConditionsDict-Output | string)\[\]required exclude\_conditions(MatchingConditionsDict-Output | string)\[\]required reasonstringrequired deleted\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired deleted\_atstring required deleted\_by\_staffbooleanrequired `scheduled_freeze.update`EventScheduledFreezeUpdate idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventScheduledFreezeUpdateMetadatarequired scheduled\_freeze\_attributes\_beforeScheduledFreezeEventLogAttributesrequired reasonstringrequired startstring required endstring | nullrequired timezonestringrequired matching\_conditions(MatchingConditionsDict-Output | string)\[\]required exclude\_conditions(MatchingConditionsDict-Output | string)\[\]required scheduled\_freeze\_attributes\_afterScheduledFreezeEventLogAttributesrequired reasonstringrequired startstring required endstring | nullrequired timezonestringrequired matching\_conditions(MatchingConditionsDict-Output | string)\[\]required exclude\_conditions(MatchingConditionsDict-Output | string)\[\]required updated\_byActorrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired updated\_atstring required updated\_by\_staffbooleanrequired `test.dequarantined`EventTestDequarantined idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventTestDequarantinedMetadatarequired quarantine\_idstring required test\_idstring test\_namestringrequired source"manual" | "auto"required Enum: `manual` `auto` original\_quarantineTestQuarantineSnapshotrequired source"manual" | "auto"required Enum: `manual` `auto` reasonstringrequired branchstring | nullrequired created\_atstring required health\_status\_at\_event"healthy" | "flaky" | "broken"required Enum: `healthy` `flaky` `broken` dequarantined\_atstring required dequarantined\_byActor | nullrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired dequarantined\_by\_staffbooleanrequired `test.quarantined`EventTestQuarantined idintegerrequired received\_atstring required triggerstringrequired repositorystringrequired pull\_requestinteger | nullrequired base\_refstring | nullrequired outcome"success" | "failure" | "pending" | "neutral"required Enum: `success` `failure` `pending` `neutral` typestringrequired metadataEventTestQuarantinedMetadatarequired quarantine\_idstring required test\_idstring test\_namestringrequired source"manual" | "auto"required Enum: `manual` `auto` reasonstringrequired branchstring | nullrequired quarantined\_atstring required health\_status\_at\_event"healthy" | "flaky" | "broken"required Enum: `healthy` `flaky` `broken` quarantined\_byActor | nullrequired type"application" | "user"required Enum: `application` `user` idinteger | string required namestringrequired quarantined\_by\_staffbooleanrequired Example Response `{ "size": 0, "per_page": 0, "events": [ { "id": 0, "received_at": "2024-01-15T09:00:00Z", "trigger": "string", "repository": "string", "pull_request": 0, "base_ref": "string", "outcome": "success", "type": "action.assign", "metadata": {} } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/logs" \ -H "Authorization: Bearer " Get aggregated event counts [#](https://docs.mergify.com/api/activity-log/#get-repository-events-aggregate-repos-owner-repository-logs-aggregate-get) ------------------------------------------------------------------------------------------------------------------------------------------------------ GET `/repos/{owner}/{repository}/logs/aggregate` Aggregations (total / histogram / event-type / outcome / trigger / pull-request / batch-pull-request facet counts) over the same filter set as \`/logs\`. The response stays consistent with what the row endpoint returns: \`total\` matches what the table will show; unchecked values produce no row in their facet list (the sidebar hides their count rather than display \`0\`). \`by\_outcome\` is derived from \`event.type\` (most types map directly; a few refine the label from event metadata); \`by\_trigger\`, \`by\_pull\_request\`, and \`by\_batch\_pull\_request\` return the top 200 values by count in the window, self-excluding their own filters. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `pull_request` integer\[\] Filter events by pull-request number. Repeatable to match several PRs at once (e.g. \`?pull\_request=1&pull\_request=2\`). `base_ref` string Get events for PRs to the given base ref min length: 1 · max length: 255 `batch_pull` integer\[\] Filter to batch (draft) pull requests' own lifecycle events by number (surfaced in the dashboard as "Batch Pull Request"). Repeatable to match several batches at once. The draft PR is the Mergify-opened pull request that speculatively checks a batch; this returns each batch's \`action.queue.checks\_start\` / \`action.queue.checks\_end\` events (which snapshot the draft PR number) plus the batch's bisection events. When \`in\_place\` is true the number is the user's own PR rather than a Mergify draft. The number rotates on checks-retry — each event snapshots the number at that attempt. Mutually exclusive with \`not\_batch\_pull\` (exclusion). `not_batch_pull` integer\[\] Exclude batch (draft) pull requests' own lifecycle events by number — the same event set \`batch\_pull\` includes, negated. Repeatable. Mirrors Datadog's facet semantics: unchecking a batch pull request in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with \`batch\_pull\` (positive include). `event_type` ("action.assign" | "action.backport" | "action.close" | "action.comment" | "action.copy" | "action.delete\_head\_branch" | "action.dequeue" | "action.dismiss\_reviews" | "action.edit" | "action.github\_actions" | "action.label" | "action.label.loop\_stopped" | "action.merge" | "action.post\_check" | "action.queue.batch\_bisection\_end" | "action.queue.batch\_bisection\_start" | "action.queue.change" | "action.queue.checks.change" | "action.queue.checks\_end" | "action.queue.checks\_postponed" | "action.queue.checks\_start" | "action.queue.conflict\_deferred" | "action.queue.enter" | "action.queue.leave" | "action.queue.merged" | "action.rebase" | "action.refresh" | "action.request\_reviews" | "action.review" | "action.squash" | "action.update" | "ci\_insights.auto\_quarantine.disabled" | "ci\_insights.auto\_quarantine.enabled" | "ci\_insights.auto\_quarantine.modified" | "ci\_insights.job\_retried" | "command.dequeue" | "command.queue" | "product.disabled" | "product.enabled" | "queue.pause.create" | "queue.pause.delete" | "queue.pause.update" | "scheduled\_freeze.create" | "scheduled\_freeze.delete" | "scheduled\_freeze.update" | "test.dequarantined" | "test.quarantined")\[\] The specific types of events to select. \`action.queue.checks\_not\_started\` is accepted as a deprecated alias of \`action.queue.checks\_postponed\`. `not_event_type` ("action.assign" | "action.backport" | "action.close" | "action.comment" | "action.copy" | "action.delete\_head\_branch" | "action.dequeue" | "action.dismiss\_reviews" | "action.edit" | "action.github\_actions" | "action.label" | "action.label.loop\_stopped" | "action.merge" | "action.post\_check" | "action.queue.batch\_bisection\_end" | "action.queue.batch\_bisection\_start" | "action.queue.change" | "action.queue.checks.change" | "action.queue.checks\_end" | "action.queue.checks\_postponed" | "action.queue.checks\_start" | "action.queue.conflict\_deferred" | "action.queue.enter" | "action.queue.leave" | "action.queue.merged" | "action.rebase" | "action.refresh" | "action.request\_reviews" | "action.review" | "action.squash" | "action.update" | "ci\_insights.auto\_quarantine.disabled" | "ci\_insights.auto\_quarantine.enabled" | "ci\_insights.auto\_quarantine.modified" | "ci\_insights.job\_retried" | "command.dequeue" | "command.queue" | "product.disabled" | "product.enabled" | "queue.pause.create" | "queue.pause.delete" | "queue.pause.update" | "scheduled\_freeze.create" | "scheduled\_freeze.delete" | "scheduled\_freeze.update" | "test.dequarantined" | "test.quarantined")\[\] Exclude events whose type matches any of the given values. Mutually exclusive with \`event\_type\` (positive include). \`action.queue.checks\_not\_started\` is accepted as a deprecated alias of \`action.queue.checks\_postponed\`. `outcome` ("success" | "failure" | "pending" | "neutral")\[\] Filter events by derived outcome label (\`success\` / \`failure\` / \`pending\` / \`neutral\`). Repeatable to match several outcomes at once (e.g. \`?outcome=success&outcome=failure\`). `not_outcome` ("success" | "failure" | "pending" | "neutral")\[\] Exclude events whose derived outcome label matches any of the given values (\`success\` / \`failure\` / \`pending\` / \`neutral\`). Repeatable. Mirrors Datadog's facet semantics: unchecking an outcome in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with \`outcome\` (positive include). `trigger` string\[\] Include only events whose \`trigger\` matches one of the given values (exact match). Repeatable. Mirrors Datadog's facet behaviour after clicking \`Only\`: the URL switches from exclusion mode to inclusion mode with a positive list — shorter than \`not\_trigger=\`. Mutually exclusive with \`not\_trigger\`. `not_trigger` string\[\] Exclude events whose \`trigger\` matches any of the given values (exact match). Repeatable. Mirrors Datadog's facet semantics: the default state is \`all triggers included\`, and unchecking a trigger in the dashboard sidebar adds it to the exclusion list. Mutually exclusive with \`trigger\` (positive include). `not_pull_request` integer\[\] Exclude events whose pull request matches any of the given numbers. Mutually exclusive with \`pull\_request\` (positive include). `received_from` string Start of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`received\_to - 1 day\`. `received_to` string End of the time range: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to \`now\`. Responses 200 Successful Response totalintegerrequired interval\_size\_secondsintegerrequired histogramHistogramBucket\[\]required startstring required endstring required countintegerrequired by\_event\_typeFacetCount\[\]required valuestringrequired countintegerrequired by\_outcomeFacetCount\[\]required valuestringrequired countintegerrequired by\_triggerFacetCount\[\]required valuestringrequired countintegerrequired by\_pull\_requestFacetCount\[\]required valuestringrequired countintegerrequired by\_batch\_pull\_requestFacetCount\[\]required valuestringrequired countintegerrequired Example Response `{ "total": 0, "interval_size_seconds": 0, "histogram": [ { "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "count": 0 } ], "by_event_type": [ { "value": "string", "count": 0 } ], "by_outcome": [ { "value": "string", "count": 0 } ], "by_trigger": [ { "value": "string", "count": 0 } ], "by_pull_request": [ { "value": "string", "count": 0 } ], "by_batch_pull_request": [ { "value": "string", "count": 0 } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/logs/aggregate" \ -H "Authorization: Bearer " Was this page helpful? Yes No Thanks for your feedback! --- # API Reference * * * Base URL `https://api.mergify.com/v1` Authentication All endpoints require a Bearer token. Two authentication methods are supported: * **Application Key** — generated from your Mergify dashboard * **GitHub Token** — a GitHub personal access token (`ghp_*`, `github_pat_*`, or `gho_*`) See [API Usage](https://docs.mergify.com/api/usage) for setup instructions. [Applications\ ------------\ \ 1 endpoint\ \ Manage your Mergify application details.\ \ GET](https://docs.mergify.com/api/applications) [Queues\ ------\ \ 7 endpoints\ \ Configure and inspect merge queues for your repositories.\ \ GET PUT DELETE POST](https://docs.mergify.com/api/queues) [Simulator\ ---------\ \ 3 endpoints\ \ Simulate Mergify behavior on pull requests and configurations.\ \ POST](https://docs.mergify.com/api/simulator) [Activity Log\ ------------\ \ 2 endpoints\ \ Retrieve and aggregate the timeline of Mergify events for a repository.\ \ GET](https://docs.mergify.com/api/activity-log) [Statistics\ ----------\ \ 19 endpoints\ \ Access merge queue and CI performance statistics.\ \ GET](https://docs.mergify.com/api/statistics) [Pull Requests\ -------------\ \ 3 endpoints\ \ Push scopes and other per-pull-request data to Mergify.\ \ PUT POST](https://docs.mergify.com/api/pull-requests) [Test Insights\ -------------\ \ 12 endpoints\ \ Access data from Test Insights.\ \ GET POST DELETE](https://docs.mergify.com/api/test-insights) [CI Insights\ -----------\ \ 2 endpoints\ \ Access data from CI Insights.\ \ GET](https://docs.mergify.com/api/ci-insights) [Scheduled Freeze\ ----------------\ \ 5 endpoints\ \ Schedule merge queue freezes for maintenance or release windows.\ \ GET POST PATCH DELETE](https://docs.mergify.com/api/scheduled-freeze) [Merge Queue\ -----------\ \ 8 endpoints\ \ Control merge queue state — pause, unpause, and inspect status.\ \ GET POST PUT DELETE](https://docs.mergify.com/api/merge-queue) [Products\ --------\ \ 3 endpoints\ \ Products endpoints for the Mergify API.\ \ PUT GET](https://docs.mergify.com/api/products) Was this page helpful? Yes No Thanks for your feedback! --- # Merge Queue * * * Get branches with active merge queues [#](https://docs.mergify.com/api/merge-queue/#get-merge-queue-branches-repos-owner-repository-merge-queue-branches-get) -------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/merge-queue/branches` Get the list of branches that currently have active merge queues Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response branchesstring\[\]required List of branches with active merge queues Example Response `{ "branches": [ "string" ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/branches" \ -H "Authorization: Bearer " Get the current status of the merge queue [#](https://docs.mergify.com/api/merge-queue/#get-merge-queue-status-endpoint-repos-owner-repository-merge-queue-status-get) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/merge-queue/status` Get the current status of the speculative checks, batches, and queued pull requests in the merge queue Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `branch` string The name of the branch Responses 200 Successful Response batchesMergeQueueStatusBatchWithSubBatch\[\]required idstring required namestringrequired parent\_idsstring \[\]required statusBatchStatusrequired code"running" | "bisecting" | "preparing" | "failed" | "merged" | "waiting\_for\_merge" | "waiting\_for\_previous\_batches" | "waiting\_for\_requeue" | "waiting\_schedule" | "waiting\_for\_batch" | "waiting\_for\_checks\_slot" | "frozen"required Enum: `running` `bisecting` `preparing` `failed` `merged` `waiting_for_merge` `waiting_for_previous_batches` `waiting_for_requeue` `waiting_schedule` `waiting_for_batch` `waiting_for_checks_slot` `frozen` see [Batch Status](https://docs.mergify.com/configuration/data-types#batch-status) batch\_filled\_slotsinteger | null max\_batch\_slotsinteger | null batch\_max\_start\_atstring | null retriesinteger max\_retriesinteger started\_atstring | nullrequired estimated\_merge\_atstring | nullrequired estimated\_ci\_finish\_atstring | nullrequired ci\_finished\_atstring | nullrequired scopesstring\[\]required queue\_rule\_namestringrequired checks\_summaryBatchChecksSummaryrequired passedintegerrequired totalintegerrequired pull\_requestsMergeQueueStatusPullRequest\[\]required numberintegerrequired min: 0 · max: 9223372036854776000 titlestringrequired urlstringrequired authorPullRequestAuthorrequired idintegerrequired loginstringrequired queued\_atstring required priority\_aliasstringrequired priority\_rule\_namestringrequired labelsstring\[\]required scopesstring\[\]required all\_scopesboolean | null Whether the pull request impacts every scope (a merge-queue barrier that cannot run in parallel with any other scope). \`false\` for an ordinary scoped pull request. github\_labelsPullRequestLabel\[\] | null idintegerrequired namestringrequired colorstringrequired defaultbooleanrequired estimated\_merge\_atstring | null estimated\_ci\_finish\_atstring | null conflict\_with\_pull\_requestsinteger\[\] | null batch\_reasonBatchReason | null kind"scope" | "directory" | "queue\_order"required Enum: `scope` `directory` `queue_order` shared\_scopesstring\[\]required shared\_directoriesstring\[\]required peer\_pull\_request\_numbersinteger\[\]required affinity\_scorenumberrequired is\_frozenboolean | null Whether an ongoing scheduled freeze holds this pull request's merge, independent of its CI status — it can be running CI and \`is\_frozen\` at once. \`false\` when no freeze affects it. dequeue\_requestedboolean | null Whether a manual removal from the queue is pending for this pull request: it was removed via the 'Remove from queue' action / \`@mergifyio dequeue\` command (or is a stacked pull request that cascade removes with one), and is awaiting completion. The pull request remains listed until it is actually removed. \`false\` when no manual removal is pending; automatic dequeues (merge, CI failure, push) do not set it. depends\_on\_pull\_requestsinteger\[\] | null Pull request numbers this one is queued behind because it depends on them: the same-repo stack predecessors the merge queue holds it behind (it declared a \`Depends-On:\` on the stack). It merges after them. \`null\` when there is no such queued dependency. all\_scopesboolean | null Whether the batch impacts every scope (a merge-queue barrier that cannot run in parallel with any other batch). \`false\` for an ordinary scoped batch. checks\_timeout\_atstring | null When the checks will time out and the batch be dequeued, if a checks timeout applies intermediate\_results\_skippedboolean True when this batch merged (or is set to merge) without its own CI passing, because a later downstream batch that includes its changes succeeded (skip\_intermediate\_results). queue\_pull\_request\_numberinteger | null The number of the pull request the batch's checks run on: the batch pull request, or the user's own pull request for in-place checks. None while the batch has no active check pull request (still preparing, or its creation failed). frozen\_batch\_aheadFrozenBatchAhead | null The batch ahead a scheduled freeze holds, and with it this batch: this batch merges only once that one has, however green its own checks are. The batch ahead may still be running its checks. \`null\` when no frozen batch is ahead, including when this batch is frozen itself, which its pull requests' \`is\_frozen\` reports. idstring required The id of the batch ahead, as \`batches\` or a bisection's \`sub\_batches\` list it. pull\_request\_numbersinteger\[\]required The pull requests queued in the batch ahead. sub\_batchesMergeQueueStatusBatchWithSubBatch\[\] | null `MergeQueueStatusBatchWithSubBatch` (circular) waiting\_pull\_requestsMergeQueueStatusPullRequest\[\]required numberintegerrequired min: 0 · max: 9223372036854776000 titlestringrequired urlstringrequired authorPullRequestAuthorrequired idintegerrequired loginstringrequired queued\_atstring required priority\_aliasstringrequired priority\_rule\_namestringrequired labelsstring\[\]required scopesstring\[\]required all\_scopesboolean | null Whether the pull request impacts every scope (a merge-queue barrier that cannot run in parallel with any other scope). \`false\` for an ordinary scoped pull request. github\_labelsPullRequestLabel\[\] | null idintegerrequired namestringrequired colorstringrequired defaultbooleanrequired estimated\_merge\_atstring | null estimated\_ci\_finish\_atstring | null conflict\_with\_pull\_requestsinteger\[\] | null batch\_reasonBatchReason | null kind"scope" | "directory" | "queue\_order"required Enum: `scope` `directory` `queue_order` shared\_scopesstring\[\]required shared\_directoriesstring\[\]required peer\_pull\_request\_numbersinteger\[\]required affinity\_scorenumberrequired is\_frozenboolean | null Whether an ongoing scheduled freeze holds this pull request's merge, independent of its CI status — it can be running CI and \`is\_frozen\` at once. \`false\` when no freeze affects it. dequeue\_requestedboolean | null Whether a manual removal from the queue is pending for this pull request: it was removed via the 'Remove from queue' action / \`@mergifyio dequeue\` command (or is a stacked pull request that cascade removes with one), and is awaiting completion. The pull request remains listed until it is actually removed. \`false\` when no manual removal is pending; automatic dequeues (merge, CI failure, push) do not set it. depends\_on\_pull\_requestsinteger\[\] | null Pull request numbers this one is queued behind because it depends on them: the same-repo stack predecessors the merge queue holds it behind (it declared a \`Depends-On:\` on the stack). It merges after them. \`null\` when there is no such queued dependency. mode"serial" | "parallel" | "isolated"required Enum: `serial` `parallel` `isolated` scope\_queuesobject pauseMergeQueuePauseResponse | null pausedbooleanrequired Whether the merge queue is currently paused reasonstring | null The reason of the merge queue pause paused\_atstring | null The date and time when the merge queue was paused automatic\_conflict\_resolution\_unsupportedboolean Example Response `{ "scope_queues": { "__default__": [ "550e8400-e29b-41d4-a716-446655440001", "550e8400-e29b-41d4-a716-446655440002" ] }, "batches": [ { "id": "550e8400-e29b-41d4-a716-446655440001", "parent_ids": [], "name": "Batch 1", "status": { "code": "running" }, "started_at": "2025-11-05T14:05:00Z", "estimated_merge_at": "2025-11-05T14:35:00Z", "estimated_ci_finish_at": "2025-11-05T14:34:30Z", "ci_finished_at": "2025-11-05T14:34:30Z", "scopes": [ "frontend", "backend" ], "queue_rule_name": "default", "checks_summary": { "passed": 45, "total": 67 }, "pull_requests": [ { "number": 1421, "title": "feat(auth): add \"Reset Password\" flow to login UI", "url": "https://github.com/org/repo/pull/1421", "author": { "id": 123, "login": "james" }, "queued_at": "2025-11-05T13:30:00Z", "priority_alias": "high", "priority_rule_name": "hotfix", "labels": [ "feature", "auth" ], "github_labels": [ { "id": 1, "name": "feature", "color": "0e8a16", "default": false }, { "id": 2, "name": "auth", "color": "1d76db", "default": false } ], "scopes": [ "frontend" ] } ] }, { "id": "550e8400-e29b-41d4-a716-446655440002", "parent_ids": [ "550e8400-e29b-41d4-a716-446655440001" ], "name": "Batch 2", "status": { "code": "bisecting" }, "started_at": "2025-11-05T13:35:00Z", "estimated_merge_at": "2025-11-05T15:35:00Z", "estimated_ci_finish_at": "2025-11-05T15:34:30Z", "ci_finished_at": "2025-11-05T14:34:30Z", "scopes": [ "frontend" ], "queue_rule_name": "default", "checks_summary": { "passed": 15, "total": 28 }, "sub_batches": [ { "id": "550e8400-e29b-41d4-a716-446655440003", "parent_ids": [], "name": "Sub Batch 1", "status": { "code": "merged" }, "started_at": "2025-11-05T13:40:00Z", "estimated_merge_at": "2025-11-05T13:50:00Z", "estimated_ci_finish_at": "2025-11-05T13:49:30Z", "ci_finished_at": "2025-11-05T13:49:30Z", "scopes": [ "frontend" ], "queue_rule_name": "default", "checks_summary": { "passed": 15, "total": 15 }, "pull_requests": [] }, { "id": "550e8400-e29b-41d4-a716-446655440004", "parent_ids": [], "name": "Sub Batch 2", "status": { "code": "running" }, "started_at": "2025-11-05T13:50:00Z", "estimated_merge_at": "2025-11-05T14:00:00Z", "estimated_ci_finish_at": "2025-11-05T13:59:30Z", "ci_finished_at": "2025-11-05T14:34:30Z", "scopes": [ "frontend" ], "queue_rule_name": "default", "checks_summary": { "passed": 0, "total": 13 }, "pull_requests": [] } ], "pull_requests": [] } ], "waiting_pull_requests": [], "automatic_conflict_resolution_unsupported": false }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/status" \ -H "Authorization: Bearer " Get a pull request in the merge queue [#](https://docs.mergify.com/api/merge-queue/#get-merge-queue-pull-request-repos-owner-repository-merge-queue-pull-pr-number-get) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GET `/repos/{owner}/{repository}/merge-queue/pull/{pr_number}` Get details about a specific pull request in the merge queue Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `pr_number` integer required The pull request number min: 0 · max: 9223372036854776000 `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response numberintegerrequired The number of the pull request min: 0 · max: 9223372036854776000 queued\_atstring required The timestamp when the pull request entered the queue estimated\_time\_of\_mergestring | nullrequired The estimated timestamp when this pull request will be merged positionintegerrequired The position of the pull request in the queue (0-indexed) priority\_rule\_namestringrequired The name of the priority rule applied to this pull request queue\_rule\_namestringrequired The name of the queue rule checks\_timeout\_atstring | nullrequired The timestamp when the checks will timeout for this pull request queue\_ruleQueueRulerequired The queue rule associated to this pull request namestringrequired The name of the queue rule configobjectrequired The configuration of the queue rule mergeability\_checkMergeQueueMergeabilityCheck | nullrequired The current state of the mergeability check check\_type"in\_place" | "draft\_pr" | "trusted"required The type of queue check: \`in\_place\` (checks run on the pull request itself), \`draft\_pr\` (checks run on a Mergify draft pull request), or \`trusted\` (no queue CI run is required: the merge relies on the pull request's own green CI, either because it already contains the base branch tip or because the base commits it is missing do not affect its scopes — the latter is Direct Merge, see https://docs.mergify.com/merge-queue/direct-merge). Enum: `in_place` `draft_pr` `trusted` queue\_pull\_request\_numberintegerrequired The number of the pull request used by the speculative check min: 0 · max: 9223372036854776000 started\_atstring | nullrequired The timestamp when the checks started for this pull request ci\_ended\_atstring | nullrequired The timestamp when the CI ended for this pull request ci\_state"pending" | "success" | "failed"required The combined state of the CI checks Enum: `pending` `success` `failed` statestringrequired The overall queue check conclusion checksQueueCheck\[\]required The list of pull request checks namestringrequired Check name descriptionstringrequired Check description urlstring | nullrequired Check detail url details\_urlstring | null External integrator's direct URL (e.g. Jenkins build URL) state"failure" | "error" | "cancelled" | "action\_required" | "timed\_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required Check state Enum: `failure` `error` `cancelled` `action_required` `timed_out` `pending` `neutral` `skipped` `stale` `success` avatar\_urlstring | nullrequired Check avatar\_url conditions\_evaluationQueueConditionEvaluationJsonSerialized | nullrequired The queue rule conditions evaluation matchbooleanrequired labelstringrequired descriptionstring | nullrequired documentation\_urlstring | nullrequired scheduleScheduleJSON | nullrequired timezonestringrequired daysobjectrequired subconditionsQueueConditionEvaluationJsonSerialized\[\]required matchbooleanrequired labelstringrequired descriptionstring | nullrequired documentation\_urlstring | nullrequired scheduleScheduleJSON | nullrequired timezonestringrequired daysobjectrequired subconditionsQueueConditionEvaluationJsonSerialized\[\]required `QueueConditionEvaluationJsonSerialized` (circular) evaluationsEvaluation\[\]required pull\_requestintegerrequired min: 0 · max: 9223372036854776000 matchbooleanrequired evaluation\_errorstring | nullrequired related\_checksstring\[\]required next\_evaluation\_atstring | nullrequired evaluationsEvaluation\[\]required pull\_requestintegerrequired min: 0 · max: 9223372036854776000 matchbooleanrequired evaluation\_errorstring | nullrequired related\_checksstring\[\]required next\_evaluation\_atstring | nullrequired Example Response `{ "number": 0, "queued_at": "2024-01-15T09:00:00Z", "estimated_time_of_merge": "2024-01-15T09:00:00Z", "position": 0, "priority_rule_name": "string", "queue_rule_name": "string", "checks_timeout_at": "2024-01-15T09:00:00Z", "queue_rule": { "name": "string", "config": {} }, "mergeability_check": { "check_type": "in_place", "queue_pull_request_number": 0, "started_at": "2024-01-15T09:00:00Z", "ci_ended_at": "2024-01-15T09:00:00Z", "ci_state": "pending", "state": "string", "checks": [ {} ], "conditions_evaluation": { "match": true, "label": "string", "description": "string", "documentation_url": "string", "schedule": {}, "subconditions": null, "evaluations": null } } }` 403 Forbidden 404 The pull request is not found in any merge queue. 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number" \ -H "Authorization: Bearer " Preview the impact of dequeuing a pull request [#](https://docs.mergify.com/api/merge-queue/#get-merge-queue-dequeue-impact-repos-owner-repository-merge-queue-pull-pr-number-dequeue-impact-get) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/merge-queue/pull/{pr_number}/dequeue-impact` Return how many batches would be interrupted, how many other pull requests would be rechecked, and how many stacked pull requests would also be dequeued if the given pull request is manually dequeued Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `pr_number` integer required The pull request number min: 0 · max: 9223372036854776000 `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response interrupted\_batchesintegerrequired Number of in-progress batches whose checks would be interrupted and restarted if this pull request is dequeued rechecked\_pull\_requestsintegerrequired Number of other pull requests from the interrupted batches that would be re-embarked and rechecked cascaded\_pull\_requestsintegerrequired Number of queued pull requests stacked on top of this one that would also be dequeued (excludes the dequeued pull request itself) Example Response `{ "interrupted_batches": 0, "rechecked_pull_requests": 0, "cascaded_pull_requests": 0 }` 403 Forbidden 404 The pull request is not found in any merge queue. 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number/dequeue-impact" \ -H "Authorization: Bearer " Dequeue a pull request from the merge queue [#](https://docs.mergify.com/api/merge-queue/#dequeue-merge-queue-pull-request-repos-owner-repository-merge-queue-pull-pr-number-dequeue-post) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/merge-queue/pull/{pr_number}/dequeue` Manually remove the given pull request (and its queued stack successors) from the merge queue Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `pr_number` integer required The pull request number min: 0 · max: 9223372036854776000 `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 204 Successful Response 403 Forbidden 404 The pull request is not found in any merge queue. 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pull/:pr_number/dequeue" \ -H "Authorization: Bearer " Pause the merge queue [#](https://docs.mergify.com/api/merge-queue/#create-merge-queue-pause-repos-owner-repository-merge-queue-pause-put) ------------------------------------------------------------------------------------------------------------------------------------------- PUT `/repos/{owner}/{repository}/merge-queue/pause` Pause the merge of the requested repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body reasonstringrequired The reason of the merge queue pause max length: 255 Responses 200 Successful Response pausedbooleanrequired Whether the merge queue is currently paused reasonstring | null The reason of the merge queue pause paused\_atstring | null The date and time when the merge queue was paused Example Response `{ "paused": true, "reason": "string", "paused_at": "2024-01-15T09:00:00Z" }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X PUT "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pause" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "reason": "string" }' Unpause merge queue [#](https://docs.mergify.com/api/merge-queue/#delete-merge-queue-pause-repos-owner-repository-merge-queue-pause-delete) -------------------------------------------------------------------------------------------------------------------------------------------- DELETE `/repos/{owner}/{repository}/merge-queue/pause` Unpause the merge queue of the requested repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 204 Successful Response 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X DELETE "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pause" \ -H "Authorization: Bearer " Get merge queue pause data [#](https://docs.mergify.com/api/merge-queue/#get-merge-queue-pause-repos-owner-repository-merge-queue-pause-get) --------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/merge-queue/pause` Checks if the merge queue is paused and returns the pause data Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response pausedbooleanrequired Whether the merge queue is currently paused reasonstring | null The reason of the merge queue pause paused\_atstring | null The date and time when the merge queue was paused Example Response `{ "paused": true, "reason": "string", "paused_at": "2024-01-15T09:00:00Z" }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/merge-queue/pause" \ -H "Authorization: Bearer " Was this page helpful? Yes No Thanks for your feedback! --- # Products * * * Manage enabled products [#](https://docs.mergify.com/api/products/#manage-products-on-a-github-repository-products-owner-repository-put) ----------------------------------------------------------------------------------------------------------------------------------------- PUT `/products/{owner}/{repository}` Manage enabled products on a repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body products("ci\_insights" | "merge\_protections" | "workflow\_automation" | "merge\_queue")\[\]required Responses 204 No content 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X PUT "https://api.mergify.com/v1/products/:owner/:repository" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "products": [\ "ci_insights"\ ] }' Get default enabled products [#](https://docs.mergify.com/api/products/#get-default-enabled-products-default-products-owner-get) --------------------------------------------------------------------------------------------------------------------------------- GET `/default_products/{owner}` Get default enabled products for new repositories Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ Responses 200 Successful Response products("ci\_insights" | "merge\_protections" | "workflow\_automation" | "merge\_queue")\[\]required Example Response `{ "products": [ "ci_insights" ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/default_products/:owner" \ -H "Authorization: Bearer " Manage default enabled products [#](https://docs.mergify.com/api/products/#manage-default-enabled-products-default-products-owner-put) --------------------------------------------------------------------------------------------------------------------------------------- PUT `/default_products/{owner}` Manage default enabled products for new repositories Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ Request Body products("ci\_insights" | "merge\_protections" | "workflow\_automation" | "merge\_queue")\[\]required Responses 204 No content 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X PUT "https://api.mergify.com/v1/default_products/:owner" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "products": [\ "ci_insights"\ ] }' Was this page helpful? Yes No Thanks for your feedback! --- # Rule Syntax * * * Workflow Automation rules live under the `pull_request_rules` key in your [configuration file](https://docs.mergify.com/configuration/file-format) , where each rule pairs a set of conditions with the actions Mergify runs when a pull request matches them. For a gentle introduction, see the [Workflow Automation overview](https://docs.mergify.com/workflow) . This page is the field-by-field reference. Fields ------ [Section titled Fields](https://docs.mergify.com/workflow/rule-syntax/#fields) `pull_request_rules` is a list, and each entry is a single rule: a YAML dictionary where `name`, `conditions`, and `actions` are required, while `description` and `disabled` are optional. `actions`[#](https://docs.mergify.com/workflow/rule-syntax/#pull-request-rule-model-actions) Actions The actions to perform when the rule matches. `conditions`[#](https://docs.mergify.com/workflow/rule-syntax/#pull-request-rule-model-conditions) [List of conditions](https://docs.mergify.com/configuration/conditions) The conditions that must be met for the rule to be evaluated. `description`[#](https://docs.mergify.com/workflow/rule-syntax/#pull-request-rule-model-description) `string` or `null`·default`null` A description of the rule. `disabled`[#](https://docs.mergify.com/workflow/rule-syntax/#pull-request-rule-model-disabled) DisabledDict or `null`·default`null` If the rule is disabled, the reason why it's disabled. `name`[#](https://docs.mergify.com/workflow/rule-syntax/#pull-request-rule-model-name) `string` The name of the rule. This is used when reporting information about a rule. It's not possible to have two rules with the same name. Conditions ---------- [Section titled Conditions](https://docs.mergify.com/workflow/rule-syntax/#conditions) `conditions` is a list of expressions describing which pull requests the rule applies to. A pull request must satisfy **every** condition in the list for the rule to match: conditions: - base = main - label = ready-to-merge Each condition is built from an attribute (such as `base`, `label`, or `#approved-reviews-by`), an operator (such as `=`, `>=`, or `~=`), and usually a value. See the [attributes list](https://docs.mergify.com/configuration/conditions#attributes-list) and [operators list](https://docs.mergify.com/configuration/conditions#operators-list) for the full set. To express “any of” or “none of” instead of “all of”, group conditions with the [`and`, `or`, and `not` operators](https://docs.mergify.com/configuration/conditions#combining-conditions-using-logical-operators) . The same condition syntax also powers [Merge Queue](https://docs.mergify.com/merge-queue) and [Merge Protections](https://docs.mergify.com/merge-protections) , so what you learn here carries over. Actions ------- [Section titled Actions](https://docs.mergify.com/workflow/rule-syntax/#actions) `actions` is a dictionary that maps an action name to its parameters. A single rule can run several actions, and Mergify runs them all when the conditions match: pull_request_rules: - name: warn and label pull requests in conflict conditions: - conflict actions: comment: message: "@{{ author }} this pull request is now in conflict 😩" label: toggle: - conflict The `{{ author }}` placeholder uses [variable substitution](https://docs.mergify.com/configuration/data-types#variable-substitution) : Mergify fills it in with the pull request’s data. Browse every available action and its parameters in the [Actions catalog](https://docs.mergify.com/workflow/actions) . Combining Rules --------------- [Section titled Combining Rules](https://docs.mergify.com/workflow/rule-syntax/#combining-rules) Mergify checks every rule against the pull request, and matching does not stop at the first hit: each rule whose conditions match runs its actions. Rule order still decides one thing. `close`, `delete_head_branch`, `merge`, `queue`, `rebase`, `squash` and `update` refuse to run twice in the same evaluation. When two matching rules both carry one of them, the rule listed first in the file runs it, and the later rule’s check reports that another action of that kind already ran. Put the rule you want to win above the others. For when an action re-runs versus stays put, see [how rules are evaluated](https://docs.mergify.com/workflow#how-rules-are-evaluated) . Disabling a Rule ---------------- [Section titled Disabling a Rule](https://docs.mergify.com/workflow/rule-syntax/#disabling-a-rule) Set `disabled` with a `reason` to keep a rule in the file but stop it from running. Mergify strikes the rule through in the **Summary** check run and prints the reason under it, so others know why: pull_request_rules: - name: automatic merge disabled: reason: paused during the release freeze conditions: - "#approved-reviews-by >= 1" actions: merge: # merge with default options Validating Your Rules --------------------- [Section titled Validating Your Rules](https://docs.mergify.com/workflow/rule-syntax/#validating-your-rules) Mergify validates your configuration on every push and reports problems in the “Checks” tab of your pull request. To catch mistakes earlier, validate and simulate rules locally with the [Mergify CLI](https://docs.mergify.com/cli/config) : mergify config validatemergify config simulate https://github.com/owner/repo/pull/142 See [Validation and Troubleshooting](https://docs.mergify.com/configuration/file-format#validation-and-troubleshooting) for the full workflow. Was this page helpful? Yes No Thanks for your feedback! [Edit this page on GitHub](https://github.com/Mergifyio/docs/edit/main/src/content/docs/workflow/rule-syntax.mdx) --- # Pull Requests * * * Set the scopes for a pull request [#](https://docs.mergify.com/api/pull-requests/#put-ci-scopes-repos-owner-repository-pulls-number-scopes-put) ------------------------------------------------------------------------------------------------------------------------------------------------ PUT `/repos/{owner}/{repository}/pulls/{number}/scopes` Set the scopes for a pull request. This addresses the scopes by pull request number alone, so the report cannot say which revision it was computed for, and the last one to arrive wins whatever head that was. Prefer \`PUT /repos/{owner}/{repository}/commits/{sha}/scopes\`, which names the revision. A scope name may hold anything except a NUL byte or an unpaired UTF-16 surrogate, neither of which Postgres can store, and is limited to 1024 characters; a report carries at most 10000 of them. A report that breaks any of these is refused in full with a 422 and nothing is stored, so the pull request keeps whatever was reported for it last. Authorization CI Application Key Path Parameters `number` integer required The pull request number min: 0 · max: 9223372036854776000 `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body scopesstring\[\]required all\_scopesboolean Responses 204 Successful Response 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X PUT "https://api.mergify.com/v1/repos/:owner/:repository/pulls/:number/scopes" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "scopes": [\ "string"\ ], "all_scopes": false }' Set the scopes for a pull request (deprecated, use PUT) [#](https://docs.mergify.com/api/pull-requests/#set-ci-scopes-repos-owner-repository-pulls-number-scopes-post) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/pulls/{number}/scopes` Deprecated Deprecated: use PUT on \`/repos/{owner}/{repository}/commits/{sha}/scopes\` instead. Authorization CI Application Key Path Parameters `number` integer required The pull request number min: 0 · max: 9223372036854776000 `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body scopesstring\[\]required all\_scopesboolean Responses 204 Successful Response 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/pulls/:number/scopes" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "scopes": [\ "string"\ ], "all_scopes": false }' Set the scopes for a commit [#](https://docs.mergify.com/api/pull-requests/#put-commit-scopes-repos-owner-repository-commits-sha-scopes-put) --------------------------------------------------------------------------------------------------------------------------------------------- PUT `/repos/{owner}/{repository}/commits/{sha}/scopes` Set the scopes a commit impacts. Prefer this over the pull request variant. Scopes computed for one revision do not describe another, so naming the revision lets a report be matched against the head a pull request actually has. A report for a revision a pull request has already moved past can no longer overwrite what its current head reported; a report \*is\* still applied to every \*\*open\*\* pull request whose head it currently is, which is the normal case. A report replaces the previous one for that revision in full: \`all\_scopes\` defaults to \`false\`, so omitting it clears a barrier previously reported for the same commit. Send the complete result of your scope computation every time. Send the pull request's head SHA (\`github.event.pull\_request.head.sha\`). That is not always the revision your job checked out: on a \`pull\_request\` event the default checkout is a merge commit, and a report keyed on that SHA matches no pull request head. A scope name may hold anything except a NUL byte or an unpaired UTF-16 surrogate, neither of which Postgres can store, and is limited to 1024 characters; a report carries at most 10000 of them. A report that breaks any of these is refused in full with a 422 and nothing is stored, so the pull request keeps whatever was reported for it last. Authorization CI Application Key Path Parameters `sha` string required The commit SHA the scopes were computed from pattern: ^\[0-9a-fA-F\]{40}$ `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body scopesstring\[\]required all\_scopesboolean Responses 204 Successful Response 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X PUT "https://api.mergify.com/v1/repos/:owner/:repository/commits/:sha/scopes" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "scopes": [\ "string"\ ], "all_scopes": false }' Was this page helpful? Yes No Thanks for your feedback! --- # Queues * * * Get merge queues configuration [#](https://docs.mergify.com/api/queues/#repository-queues-configuration-repos-owner-repository-queues-configuration-get) --------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/queues/configuration` Deprecated Get the list of all merge queues configuration sorted by processing order Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response configurationQueueRule\[\]required The queues configuration of the repository namestringrequired The name of the queue rule configobjectrequired The configuration of the queue rule Example Response `{ "configuration": [ { "name": "string", "config": {} } ] }` 403 Forbidden 404 Not found 409 Conflict 422 The configuration file is invalid. Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/queues/configuration" \ -H "Authorization: Bearer " Pause the merge queue [#](https://docs.mergify.com/api/queues/#create-queue-pause-repos-owner-repository-queue-pause-put) -------------------------------------------------------------------------------------------------------------------------- PUT `/repos/{owner}/{repository}/queue/pause` Deprecated Pause the merge of the requested repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body reasonstringrequired The reason of the queue pause max length: 255 Responses 200 Successful Response queue\_pauseQueuePause\[\]required The pause of the repository reasonstringrequired The reason of the queue pause max length: 255 pause\_datestring required The date and time of the freeze Example Response `{ "queue_pause": [ { "reason": "string", "pause_date": "2024-01-15T09:00:00Z" } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X PUT "https://api.mergify.com/v1/repos/:owner/:repository/queue/pause" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "reason": "string" }' Unpause merge queue [#](https://docs.mergify.com/api/queues/#delete-queue-pause-repos-owner-repository-queue-pause-delete) --------------------------------------------------------------------------------------------------------------------------- DELETE `/repos/{owner}/{repository}/queue/pause` Deprecated Unpause the merge queue of the requested repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 204 Successful Response 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X DELETE "https://api.mergify.com/v1/repos/:owner/:repository/queue/pause" \ -H "Authorization: Bearer " Get queue pause data [#](https://docs.mergify.com/api/queues/#get-queue-pause-repos-owner-repository-queue-pause-get) ---------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/queue/pause` Deprecated Checks if the merge queue is paused and get the queue pause data Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response queue\_pauseQueuePause\[\]required The pause of the repository reasonstringrequired The reason of the queue pause max length: 255 pause\_datestring required The date and time of the freeze Example Response `{ "queue_pause": [ { "reason": "string", "pause_date": "2024-01-15T09:00:00Z" } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/queue/pause" \ -H "Authorization: Bearer " Unpause merge queue [#](https://docs.mergify.com/api/queues/#delete-queue-pause-repos-owner-repository-queue-pause-delete-post) -------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/queue/pause/delete` Deprecated Unpause the merge queue of the requested repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 204 Successful Response 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/queue/pause/delete" \ -H "Authorization: Bearer " Get merge queues [#](https://docs.mergify.com/api/queues/#repository-queues-repos-owner-repository-queues-get) --------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/queues` Deprecated Get the list of pull requests queued in a merge queue of a repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response queuesQueue\[\]required The queues of the repository branchBranchrequired The branch of this queue namestringrequired The name of the branch pull\_requestsPullRequestQueued\[\]required The pull requests in this queue numberintegerrequired The number of the pull request min: 0 · max: 9223372036854776000 positionintegerrequired The position of the pull request in the queue. The first pull request in the queue is at position 0 priorityintegerrequired The priority of this pull request effective\_priorityintegerrequired The effective priority of this pull request priority\_aliasstringrequired The priority textual value of this pull request queue\_ruleQueueRulerequired The queue rule associated to this pull request namestringrequired The name of the queue rule configobjectrequired The configuration of the queue rule queued\_atstring required The timestamp when the pull requested has entered in the queue speculative\_check\_pull\_requestQueues\_SpeculativeCheckPullRequest | nullrequired Use \`mergeability\_check\` instead in\_placebooleanrequired Whether the pull request has been checked in-place numberintegerrequired The number of the pull request used by the speculative check min: 0 · max: 9223372036854776000 started\_atstring | nullrequired The timestamp when the checks have started for this pull request ended\_atstring | nullrequired The timestamp when the checks have ended for this pull request checksQueueCheck\[\]required The list of pull request checks namestringrequired Check name descriptionstringrequired Check description urlstring | nullrequired Check detail url details\_urlstring | null External integrator's direct URL (e.g. Jenkins build URL) state"failure" | "error" | "cancelled" | "action\_required" | "timed\_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required Check state Enum: `failure` `error` `cancelled` `action_required` `timed_out` `pending` `neutral` `skipped` `stale` `success` avatar\_urlstring | nullrequired Check avatar\_url evaluated\_conditionsstringrequired The queue rule conditions evaluation report state"failure" | "error" | "cancelled" | "action\_required" | "timed\_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required The global state of the checks Enum: `failure` `error` `cancelled` `action_required` `timed_out` `pending` `neutral` `skipped` `stale` `success` mergeability\_checkBriefMergeabilityCheck | nullrequired Information about the mergeability check currently processed check\_type"in\_place" | "draft\_pr" | "trusted"required The type of queue check: \`in\_place\` (checks run on the pull request itself), \`draft\_pr\` (checks run on a Mergify draft pull request), or \`trusted\` (no queue CI run is required: the merge relies on the pull request's own green CI, either because it already contains the base branch tip or because the base commits it is missing do not affect its scopes — the latter is Direct Merge, see https://docs.mergify.com/merge-queue/direct-merge). Enum: `in_place` `draft_pr` `trusted` pull\_request\_numberintegerrequired The number of the pull request used by the speculative check min: 0 · max: 9223372036854776000 started\_atstring | nullrequired The timestamp when the checks have started for this pull request ended\_atstring | nullrequired The timestamp when the checks have ended for this pull request state"failure" | "error" | "cancelled" | "action\_required" | "timed\_out" | "pending" | "neutral" | "skipped" | "stale" | "success"required The global state of the checks Enum: `failure` `error` `cancelled` `action_required` `timed_out` `pending` `neutral` `skipped` `stale` `success` estimated\_time\_of\_mergestring | nullrequired The estimated timestamp when this pull request will be merged partition\_namestringrequired The name of the partition, if any, in which the pull request is queued Example Response `{ "queues": [ { "branch": { "name": "main" }, "pull_requests": [ { "number": 5678, "position": 1, "priority": 100, "effective_priority": 100, "priority_alias": "low", "partition_name": "__default__", "queue_rule": { "name": "default", "config": { "priority": 100, "batch_size": 1, "batch_max_wait_time": 0, "allow_inplace_checks": true, "allow_queue_branch_edit": false, "checks_timeout": 60, "draft_bot_account": "", "queue_branch_prefix": "mergify/merge-queue/", "queue_branch_merge_method": "fast-forward", "batch_max_failure_resolution_attempts": 10, "commit_message_template": "", "merge_bot_account": "", "merge_method": "merge", "update_bot_account": "", "update_method": "rebase" } }, "speculative_check_pull_request": { "in_place": true, "number": 5678, "started_at": "2021-10-14T14:19:12+00:00", "ended_at": "2021-10-14T15:00:42+00:00", "checks": [], "evaluated_conditions": "", "state": "success" }, "mergeability_check": { "check_type": "in_place", "pull_request_number": 5678, "started_at": "2021-10-14T14:19:12+00:00", "ended_at": "2021-10-14T15:00:42+00:00", "state": "success" }, "queued_at": "2021-10-14T14:19:12+00:00", "estimated_time_of_merge": "2021-10-14T15:19:12+00:00" }, { "number": 4242, "position": 1, "priority": 100, "effective_priority": 100, "priority_alias": "low", "partition_name": "__default__", "queue_rule": { "name": "default", "config": { "priority": 100, "batch_size": 1, "batch_max_wait_time": 0, "allow_inplace_checks": true, "allow_queue_branch_edit": false, "checks_timeout": 60, "draft_bot_account": "", "queue_branch_prefix": "mergify/merge-queue/", "queue_branch_merge_method": "fast-forward", "batch_max_failure_resolution_attempts": 10, "commit_message_template": "", "merge_bot_account": "", "merge_method": "merge", "update_bot_account": "", "update_method": "rebase" } }, "speculative_check_pull_request": { "in_place": false, "number": 7899, "started_at": "2021-10-14T14:19:12+00:00", "ended_at": "2021-10-14T15:00:42+00:00", "checks": [], "evaluated_conditions": "", "state": "success" }, "mergeability_check": { "check_type": "draft_pr", "pull_request_number": 7899, "started_at": "2021-10-14T14:19:12+00:00", "ended_at": "2021-10-14T15:00:42+00:00", "state": "success" }, "queued_at": "2021-10-14T14:19:12+00:00", "estimated_time_of_merge": "2021-10-14T15:19:12+00:00" } ] } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/queues" \ -H "Authorization: Bearer " Get the base refs in the repository [#](https://docs.mergify.com/api/queues/#get-queue-base-refs-repos-owner-repository-queues-branches-get) --------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/queues/branches` Deprecated Retrieve a list of base refs branches affected by queue activity Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response base\_refsstring\[\]required Example Response `{ "base_refs": [ "string" ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/queues/branches" \ -H "Authorization: Bearer " Was this page helpful? Yes No Thanks for your feedback! --- # Simulator * * * Get a Mergify simulation for a pull request [#](https://docs.mergify.com/api/simulator/#simulator-pull-repos-owner-repository-pulls-number-simulator-post) ----------------------------------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/pulls/{number}/simulator` Get a simulation of what Mergify will do on a pull request Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ `number` integer required The pull request number min: 0 · max: 9223372036854776000 Request Body mergify\_ymlstringrequired A Mergify configuration max length: 1048576 Responses 200 Successful Response titlestringrequired The title of the Mergify check run simulation summarystringrequired The summary of the Mergify check run simulation deprecationsDeprecationInfo\[\]required Deprecation notices detected in the configuration messagestringrequired Human-readable deprecation reason deadlinestring required Date after which the deprecated configuration will be rejected path\_to\_fieldstring\[\] | nullrequired Path to the deprecated field inside the configuration, or null when the deprecation is not tied to a specific field Example Response `{ "title": "string", "summary": "string", "deprecations": [ { "message": "string", "deadline": "2024-01-15", "path_to_field": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/pulls/:number/simulator" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "mergify_yml": "string" }' Get a Mergify simulation for a repository [#](https://docs.mergify.com/api/simulator/#simulator-repo-repos-owner-repository-simulator-post) -------------------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/simulator` Get a simulation of what Mergify will do for this repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body mergify\_ymlstringrequired A Mergify configuration max length: 1048576 Responses 200 Successful Response titlestringrequired The title of the Mergify check run simulation summarystringrequired The summary of the Mergify check run simulation deprecationsDeprecationInfo\[\]required Deprecation notices detected in the configuration messagestringrequired Human-readable deprecation reason deadlinestring required Date after which the deprecated configuration will be rejected path\_to\_fieldstring\[\] | nullrequired Path to the deprecated field inside the configuration, or null when the deprecation is not tied to a specific field Example Response `{ "title": "string", "summary": "string", "deprecations": [ { "message": "string", "deadline": "2024-01-15", "path_to_field": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/simulator" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "mergify_yml": "string" }' Get a Mergify configuration simulation for a repository [#](https://docs.mergify.com/api/simulator/#repository-configuration-simulator-repos-owner-repository-configuration-simulator-post) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/configuration-simulator` Get a simulation of what Mergify will do for this repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body mergify\_ymlstringrequired A Mergify configuration max length: 1048576 Responses 200 Successful Response messagestringrequired The message of the Mergify check run simulation deprecationsDeprecationInfo\[\]required Deprecation notices detected in the configuration messagestringrequired Human-readable deprecation reason deadlinestring required Date after which the deprecated configuration will be rejected path\_to\_fieldstring\[\] | nullrequired Path to the deprecated field inside the configuration, or null when the deprecation is not tied to a specific field unused\_sectionsUnusedSectionInfo\[\] | nullrequired Sections of the configuration that are never evaluated, because the product that reads them is not enabled on this repository. \`null\` when the repository's products could not be determined: nothing is claimed in either direction then, and an empty list is not what that state looks like. sectionstringrequired Top-level section of the configuration that is never evaluated product"workflow\_automation" | "merge\_queue" | "merge\_protections"required The product that would evaluate this section Enum: `workflow_automation` `merge_queue` `merge_protections` product\_namestringrequired Human-readable name of that product product\_urlstringrequired Where to enable that product for this repository, on the dashboard Example Response `{ "message": "The configuration is valid", "deprecations": [], "unused_sections": [ { "section": "pull_request_rules", "product": "workflow_automation", "product_name": "Workflow Automation", "product_url": "https://dashboard.mergify.com/orgs/Mergifyio/repos/mergify-engine/workflow-automation" } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/configuration-simulator" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "mergify_yml": "string" }' Was this page helpful? Yes No Thanks for your feedback! --- # Scheduled Freeze * * * Get scheduled freezes [#](https://docs.mergify.com/api/scheduled-freeze/#get-scheduled-freezes-repos-owner-repository-scheduled-freeze-get) -------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/scheduled_freeze` Get all the ongoing or scheduled freezes for the repository specified in the path Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response scheduled\_freezesScheduledFreezeObjectResponse\[\]required idstring required reasonstringrequired startstring required endstring | nullrequired timezonestringrequired matching\_conditions(MatchingConditionsDict-Output | string)\[\]required exclude\_conditions(MatchingConditionsDict-Output | string)\[\] Example Response `{ "scheduled_freezes": [ { "id": "string", "reason": "string", "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "timezone": "string", "matching_conditions": null, "exclude_conditions": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze" \ -H "Authorization: Bearer " Create a scheduled freeze [#](https://docs.mergify.com/api/scheduled-freeze/#create-scheduled-freeze-repos-owner-repository-scheduled-freeze-post) --------------------------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/scheduled_freeze` Create a scheduled freeze for the repository specified in the path Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body reasonstringrequired The reason for the scheduled freeze. max length: 10000 startstring | nullrequired When the scheduled freeze begins (date and time in ISO 8601 format without TZ). Begins now if the attribute is null. endstring | null When the scheduled freeze ends (date and time in ISO 8601 format without TZ). timezonestringrequired Timezone where the freeze is expected to happen. matching\_conditions(MatchingConditionsDict-Input | string)\[\] List of conditions used to match pull requests that need to be frozen during the scheduled freeze. Defaults to an empty list, which matches all pull requests. exclude\_conditions(MatchingConditionsDict-Input | string)\[\] List of conditions used to exclude pull requests from the scheduled freeze. Pull requests matching these conditions will not be frozen. Responses 201 Successful Response idstring required reasonstringrequired startstring required endstring | nullrequired timezonestringrequired matching\_conditions(MatchingConditionsDict-Output | string)\[\]required exclude\_conditions(MatchingConditionsDict-Output | string)\[\] Example Response `{ "id": "string", "reason": "string", "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "timezone": "string", "matching_conditions": [ { "and": null, "or": null, "not": {} } ], "exclude_conditions": [ { "and": null, "or": null, "not": {} } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "reason": "string", "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "timezone": "string", "matching_conditions": [\ {\ "and": null,\ "or": null,\ "not": {}\ }\ ], "exclude_conditions": [\ {\ "and": null,\ "or": null,\ "not": {}\ }\ ] }' Update a scheduled freeze [#](https://docs.mergify.com/api/scheduled-freeze/#update-scheduled-freeze-repos-owner-repository-scheduled-freeze-freeze-id-patch) -------------------------------------------------------------------------------------------------------------------------------------------------------------- PATCH `/repos/{owner}/{repository}/scheduled_freeze/{freeze_id}` Update an existing scheduled freeze on the repository specified in the path. Only the fields provided in the request body will be updated. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `freeze_id` string required The scheduled freeze \`id\` `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body reasonstring | null The reason for the scheduled freeze. startstring | null When the scheduled freeze begins (date and time in ISO 8601 format without TZ). Can only be updated if the scheduled freeze has not yet begun. Set to null to start now. endstring | null When the scheduled freeze ends (date and time in ISO 8601 format without TZ). Set to null for an indefinite freeze. timezonestring | null Timezone where the freeze is expected to happen. matching\_conditions(MatchingConditionsDict-Input | string)\[\] | null List of conditions used to match pull requests that need to be frozen during the scheduled freeze. exclude\_conditions(MatchingConditionsDict-Input | string)\[\] | null List of conditions used to exclude pull requests from the scheduled freeze. Pull requests matching these conditions will not be frozen. Responses 200 Successful Response idstring required reasonstringrequired startstring required endstring | nullrequired timezonestringrequired matching\_conditions(MatchingConditionsDict-Output | string)\[\]required exclude\_conditions(MatchingConditionsDict-Output | string)\[\] Example Response `{ "id": "string", "reason": "string", "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "timezone": "string", "matching_conditions": [ { "and": null, "or": null, "not": {} } ], "exclude_conditions": [ { "and": null, "or": null, "not": {} } ] }` 400 The scheduled freeze \`start\` attribute cannot be updated, because the scheduled freeze has already started 403 Forbidden 404 The scheduled freeze with the given id does not exist 409 Conflict 422 Unprocessable entity Example Request curl -X PATCH "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze/:freeze_id" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "reason": "string", "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "timezone": "string", "matching_conditions": [\ {\ "and": null,\ "or": null,\ "not": {}\ }\ ], "exclude_conditions": [\ {\ "and": null,\ "or": null,\ "not": {}\ }\ ] }' Delete a scheduled freeze [#](https://docs.mergify.com/api/scheduled-freeze/#delete-scheduled-freeze-repos-owner-repository-scheduled-freeze-freeze-id-delete) --------------------------------------------------------------------------------------------------------------------------------------------------------------- DELETE `/repos/{owner}/{repository}/scheduled_freeze/{freeze_id}` Deprecated Delete an existing scheduled freeze on the repository specified in the path Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `freeze_id` string required The scheduled freeze \`id\` `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body delete\_reasonstringrequired The reason for the deletion Responses 204 Successful Response 403 Forbidden 404 The scheduled freeze with the given id does not exist 409 Conflict 422 Unprocessable entity Example Request curl -X DELETE "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze/:freeze_id" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "delete_reason": "string" }' Delete a scheduled freeze [#](https://docs.mergify.com/api/scheduled-freeze/#delete-scheduled-freeze-repos-owner-repository-scheduled-freeze-freeze-id-delete-post) -------------------------------------------------------------------------------------------------------------------------------------------------------------------- POST `/repos/{owner}/{repository}/scheduled_freeze/{freeze_id}/delete` Delete an existing scheduled freeze on the repository specified in the path Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `freeze_id` string required The scheduled freeze \`id\` `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body delete\_reasonstringrequired The reason for the deletion Responses 204 Successful Response 403 Forbidden 404 The scheduled freeze with the given id does not exist 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/repos/:owner/:repository/scheduled_freeze/:freeze_id/delete" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "delete_reason": "string" }' Was this page helpful? Yes No Thanks for your feedback! --- # Test Insights * * * Search tests [#](https://docs.mergify.com/api/test-insights/#ci-search-tests) ------------------------------------------------------------------------------ GET `/ci/{owner}/repositories/{repository}/search/tests` Search tests in a repository. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `test_name` string\[\] Filter by test name. Pass multiple times to combine matches. Supports glob patterns (\`\*\`, \`?\`). Omit to return all test identities. `test_name_exclude` string\[\] The test name to exclude `pipeline_name` string\[\] The pipeline name to filter on `pipeline_name_exclude` string\[\] The pipeline name to exclude `job_name` string\[\] The job name to filter on `job_name_exclude` string\[\] The job name to exclude `health_status` ("healthy" | "flaky" | "broken")\[\] The health status to filter on `health_status_exclude` ("healthy" | "flaky" | "broken")\[\] The health status to exclude `health_confidence` ("low" | "medium" | "high")\[\] The health confidence to filter on `health_confidence_exclude` ("low" | "medium" | "high")\[\] The health confidence to exclude `failed_executions_impact` ("low" | "medium" | "high")\[\] The failed executions impact to filter on `failed_executions_impact_exclude` ("low" | "medium" | "high")\[\] The failed executions impact to exclude `cursor` string The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages `per_page` integer The number of items per page min: 1 · max: 100 `sort` "executions\_count" | "test\_name" | "pipeline\_name" | "job\_name" | "health\_status" | "health\_confidence" | "failed\_executions\_impact" | "failed\_executions\_ratio" Sort field `direction` "asc" | "desc" Sort direction Responses 200 Successful Response sizeintegerrequired The number of items in this page per\_pageintegerrequired The number of items per page testsTestSearchResult\[\]required Test identities matching the search query. test\_idstring required Stable identifier of the test. Pass it to the per-test endpoints to fetch details, metrics, or failures. test\_namestringrequired Fully qualified name of the test as reported by the CI provider. pipeline\_namestringrequired Name of the pipeline (workflow) that ran the test. job\_namestringrequired Name of the job within the pipeline that ran the test. metricsTestSearchResultMetricsrequired Health metrics of the test identity. health\_status"healthy" | "flaky" | "broken"required Current health classification of the test: healthy, flaky, or broken. Enum: `healthy` `flaky` `broken` health\_confidence"low" | "medium" | "high"required Confidence in the health classification, derived from how many times the test has been rerun. Enum: `low` `medium` `high` failed\_executions\_impact"low" | "medium" | "high" | nullrequired Impact of the test's failures, derived from its failure ratio. \`null\` for healthy tests, which have no meaningful failure impact. totalintegerrequired Total number of test identities matching the search query, across all pages. Example Response `{ "size": 0, "per_page": 0, "tests": [ { "test_id": "string", "test_name": "string", "pipeline_name": "string", "job_name": "string", "metrics": {} } ], "total": 0 }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/search/tests" \ -H "Authorization: Bearer " Get detailed information about a test [#](https://docs.mergify.com/api/test-insights/#get-test-details-ci-owner-repositories-repository-tests-test-id-get) ----------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/ci/{owner}/repositories/{repository}/tests/{test_id}` Get detailed information about a test. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `test_id` string required ID of the test `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `pipeline_name` string Only read the test's executions in this pipeline. Omit to read them across every pipeline. min length: 1 · max length: 255 `job_name` string Only read the test's executions in this job. Omit to read them across every job. min length: 1 · max length: 255 Responses 200 Successful Response repositorystringrequired test\_namestringrequired test\_idstring required health\_statusstringrequired last\_conclusionstringrequired failure\_rationumberrequired flakiness\_rationumberrequired success\_rationumberrequired flaky\_detection\_enabledbooleanrequired first\_failure\_atstring | nullrequired first\_failure\_commitstring | nullrequired first\_failure\_pullGetTestDetailsResponsePull | nullrequired idintegerrequired numberintegerrequired titlestringrequired userGetTestDetailsResponseUserrequired idintegerrequired loginstringrequired last\_failure\_atstring | nullrequired last\_success\_atstring | nullrequired test\_frameworkstring | nullrequired test\_framework\_versionstring | nullrequired test\_programming\_languagestring | nullrequired test\_filepathstring | nullrequired test\_function\_namestring | nullrequired Example Response `{ "repository": "string", "test_name": "string", "test_id": "string", "health_status": "string", "last_conclusion": "string", "failure_ratio": 0, "flakiness_ratio": 0, "success_ratio": 0, "flaky_detection_enabled": true, "first_failure_at": "2024-01-15T09:00:00Z", "first_failure_commit": "string", "first_failure_pull": { "id": 0, "number": 0, "title": "string", "user": { "id": 0, "login": "string" } }, "last_failure_at": "2024-01-15T09:00:00Z", "last_success_at": "2024-01-15T09:00:00Z", "test_framework": "string", "test_framework_version": "string", "test_programming_language": "string", "test_filepath": "string", "test_function_name": "string" }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id" \ -H "Authorization: Bearer " Get a single test stat as a time series [#](https://docs.mergify.com/api/test-insights/#ci-test-stats) ------------------------------------------------------------------------------------------------------- GET `/ci/{owner}/repositories/{repository}/tests/{test_id}/stats/{stat}` Return one of the test stats over the requested window, one point per UTC day, with a summary value over the full window. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `test_id` string required ID of the test `stat` "success\_count" | "failure\_count" | "flaky\_count" | "mean\_duration" required `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `window` "7d" | "30d" Period to cover: the last 7 or 30 UTC days, today included. `pipeline_name` string Only read the test's executions in this pipeline. Omit to read them across every pipeline. min length: 1 · max length: 255 `job_name` string Only read the test's executions in this job. Omit to read them across every job. min length: 1 · max length: 255 Responses 200 Successful Response Discriminated by `stat` — 4 types `success_count`TestCountStatsResponse valueintegerrequired value\_over\_time\_TestStatsBucket\_int\_\[\]required startstring required endstring required valueintegerrequired stat"success\_count" | "failure\_count" | "flaky\_count"required Enum: `success_count` `failure_count` `flaky_count` `failure_count`TestCountStatsResponse valueintegerrequired value\_over\_time\_TestStatsBucket\_int\_\[\]required startstring required endstring required valueintegerrequired stat"success\_count" | "failure\_count" | "flaky\_count"required Enum: `success_count` `failure_count` `flaky_count` `flaky_count`TestCountStatsResponse valueintegerrequired value\_over\_time\_TestStatsBucket\_int\_\[\]required startstring required endstring required valueintegerrequired stat"success\_count" | "failure\_count" | "flaky\_count"required Enum: `success_count` `failure_count` `flaky_count` `mean_duration`TestDurationStatsResponse valuenumberrequired value\_over\_time\_TestStatsBucket\_float\_\[\]required startstring required endstring required valuenumberrequired statstringrequired Example Response `{ "value": 0, "value_over_time": [ { "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "value": 0 } ], "stat": "success_count" }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/stats/:stat" \ -H "Authorization: Bearer " Get a test's health transitions over time [#](https://docs.mergify.com/api/test-insights/#ci-test-health-transitions) ---------------------------------------------------------------------------------------------------------------------- GET `/ci/{owner}/repositories/{repository}/tests/{test_id}/health-transitions` Return the moments a test's health (healthy/flaky/broken) changed over the requested window: the edges of the series, not the full series. The first point is the health where the window opens, at \`first\_activity\_at\`; each later one is the run at which the test turned flaky or broken, or recovered. Without a pipeline and job, the worst health across the test's jobs wins at each instant. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `test_id` string required ID of the test `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `window` "7d" | "30d" Period to cover: the last 7 or 30 UTC days, today included. `pipeline_name` string Only read the test's executions in this pipeline. Omit to read them across every pipeline. min length: 1 · max length: 255 `job_name` string Only read the test's executions in this job. Omit to read them across every job. min length: 1 · max length: 255 Responses 200 Successful Response transitionsHealthTransition\[\]required Health changes over the window, oldest first. Consecutive entries always differ; the first entry is the health at \`first\_activity\_at\`. Without a pipeline and job, the worst health across the test's jobs wins at each instant. atstring required Run at which the test's health changed to \`health\_status\`, or \`first\_activity\_at\` for the first point. health\_status"healthy" | "flaky" | "broken"required Health the test held from \`at\` until the next transition. Enum: `healthy` `flaky` `broken` exception\_typestring | null Exception raised by the run that opened this transition. Always null for a recovery, for the first point, when that run passed (a flaky test can turn flaky on a pass), and when the run is no longer retained. pull\_requestGetTestDetailsResponsePull | null Pull request whose merge commit the run that opened this transition ran on. Null in three cases: on a recovery, because a test can stop failing without a PR fixing it and no 'fixed by' is attributed; when that commit cannot be traced back to a merged pull request; and on the first point. idintegerrequired numberintegerrequired titlestringrequired userGetTestDetailsResponseUserrequired idintegerrequired loginstringrequired first\_activity\_atstring | nullrequired The test's first run in the window, the window start when it also ran before, or null when it had no activity. A consumer can treat a \`first\_activity\_at\` well after the window start as the test's genuine origin, and one at the window edge as history that predates the retained window. Example Response `{ "transitions": [ { "at": "2024-01-15T09:00:00Z", "health_status": "healthy", "exception_type": "string", "pull_request": {} } ], "first_activity_at": "2024-01-15T09:00:00Z" }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/health-transitions" \ -H "Authorization: Bearer " Get test failures [#](https://docs.mergify.com/api/test-insights/#ci-test-failures) ------------------------------------------------------------------------------------ GET `/ci/{owner}/repositories/{repository}/tests/{test_id}/failures` Get test failures. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `test_id` string required ID of the test `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `pipeline_name` string Only read the test's executions in this pipeline. Omit to read them across every pipeline. min length: 1 · max length: 255 `job_name` string Only read the test's executions in this job. Omit to read them across every job. min length: 1 · max length: 255 Responses 200 Successful Response failuresTestFailure\[\]required idstring required exception\_typestringrequired exception\_messagestringrequired failure\_countintegerrequired first\_failure\_atstring required last\_failure\_atstring required Example Response `{ "failures": [ { "id": "string", "exception_type": "string", "exception_message": "string", "failure_count": 0, "first_failure_at": "2024-01-15T09:00:00Z", "last_failure_at": "2024-01-15T09:00:00Z" } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/failures" \ -H "Authorization: Bearer " Get test failure [#](https://docs.mergify.com/api/test-insights/#ci-test-failure) ---------------------------------------------------------------------------------- GET `/ci/{owner}/repositories/{repository}/tests/{test_id}/failures/{failure_id}` Get test failure. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `test_id` string required ID of the test `failure_id` string required ID of the failure `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `pipeline_name` string Only read the test's executions in this pipeline. Omit to read them across every pipeline. min length: 1 · max length: 255 `job_name` string Only read the test's executions in this job. Omit to read them across every job. min length: 1 · max length: 255 Responses 200 Successful Response idstring required exception\_typestringrequired exception\_messagestringrequired failure\_countintegerrequired first\_failure\_atstring required last\_failure\_atstring required latest\_eventsTestFailureEvent\[\]required idstringrequired failed\_atstring required exception\_stacktracestring | nullrequired test\_filepathstring | nullrequired test\_programming\_languagestring | nullrequired job\_urlstring | null Example Response `{ "id": "string", "exception_type": "string", "exception_message": "string", "failure_count": 0, "first_failure_at": "2024-01-15T09:00:00Z", "last_failure_at": "2024-01-15T09:00:00Z", "latest_events": [ { "id": "string", "failed_at": "2024-01-15T09:00:00Z", "exception_stacktrace": "string", "test_filepath": "string", "test_programming_language": "string", "job_url": "string" } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/failures/:failure_id" \ -H "Authorization: Bearer " List a test's executions [#](https://docs.mergify.com/api/test-insights/#ci-test-executions) --------------------------------------------------------------------------------------------- GET `/ci/{owner}/repositories/{repository}/tests/{test_id}/executions` List the identities under which this test ran on the default branch over the requested time window, ordered by total executions. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `test_id` string required ID of the test `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `cursor` string The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages `per_page` integer The number of items per page min: 1 · max: 100 `sort` "executions\_count" | "pipeline\_name" | "job\_name" Sort field `direction` "asc" | "desc" Sort direction `window` "7d" | "30d" Period to cover: the last 7 or 30 UTC days, today included. Responses 200 Successful Response sizeintegerrequired The number of items in this page per\_pageintegerrequired The number of items per page executionsTestExecutionResult\[\]required Test identities under which this test ran on the default branch over the requested time window, ordered by total executions. test\_idstring required Stable identifier of the test. Matches the \`test\_id\` in the URL. test\_namestringrequired Fully qualified name of the test as reported by the CI provider. pipeline\_namestringrequired Name of the pipeline (workflow) that ran the test. job\_namestringrequired Name of the job within the pipeline that ran the test. executions\_countintegerrequired Number of executions of this test under this identity over the requested time window. Example Response `{ "size": 0, "per_page": 0, "executions": [ { "test_id": "string", "test_name": "string", "pipeline_name": "string", "job_name": "string", "executions_count": 0 } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/:test_id/executions" \ -H "Authorization: Bearer " List quarantined tests [#](https://docs.mergify.com/api/test-insights/#get-quarantined-tests-with-params-token-auth-ci-owner-repositories-repository-quarantines-get) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/ci/{owner}/repositories/{repository}/quarantines` List the tests currently quarantined in the repository, ordered by quarantine creation time ascending. A quarantine applies to a specific branch or to all branches when \`branch\` is \`null\`. Pagination is opt-in: pass \`per\_page\` (and optionally \`cursor\`) to receive a bounded page with RFC 5988 navigation links. Omitting \`per\_page\` returns the full list in a single response — this shortcut exists for backward compatibility and is expected to go away once all callers paginate. Authorization (any one of) Admin Application Key CI Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `branch` string Deprecated: use \`branch\_name\`. min length: 1 · max length: 255 `test_id` string \[\] The test identifier to filter on `source` "manual" | "auto" `branch_name` string\[\] The branch name to filter on. Quarantines applying to every branch always match. `branch_name_exclude` string\[\] The branch name to exclude. Quarantines applying to every branch are kept. `pipeline_name` string\[\] The pipeline name to filter on. Quarantines applying to every pipeline always match. `pipeline_name_exclude` string\[\] The pipeline name to exclude. Quarantines applying to every pipeline are kept. `job_name` string\[\] The job name to filter on. Quarantines applying to every job always match. `job_name_exclude` string\[\] The job name to exclude. Quarantines applying to every job are kept. `test_name` string\[\] The test name to filter on `test_name_exclude` string\[\] The test name to exclude `health_status` ("healthy" | "flaky" | "broken")\[\] The health status to filter on. Tests with no recent runs are left out. `health_status_exclude` ("healthy" | "flaky" | "broken")\[\] The health status to exclude. Tests with no recent runs are kept. `cursor` string The opaque cursor of the current page. Must be extracted from RFC 5988 pagination links to get the previous/next pages. `per_page` integer The number of items per page. Omit to receive the full list in a single response; pass a value to opt into RFC 5988 cursor pagination. min: 1 · max: 100 `sort` QuarantinesSort Sort field `direction` "asc" | "desc" Sort direction: \`asc\` for oldest first, \`desc\` for newest first Responses 200 Successful Response sizeintegerrequired The number of items in this page per\_pageinteger | nullrequired The number of items per page, or \`null\` when the endpoint was called without \`per\_page\` and returned the full list in a single response. quarantined\_testsQuarantinedTest\[\]required idstring required Unique identifier of the quarantine record. test\_namestringrequired Fully qualified name of the quarantined test. test\_idstring required Stable identifier of the test, derived from its name. Identical across every quarantine of the same test and matches the \`test\_id\` filter on the list endpoint. reasonstringrequired Free-form reason recorded when the test was quarantined. branchstring | nullrequired Deprecated: use \`branch\_name\`. branch\_namestring | nullrequired Branch this quarantine applies to. \`null\` means the test is quarantined on every branch. pipeline\_namestring | nullrequired Pipeline this quarantine applies to. \`null\` means the test is quarantined in every pipeline. job\_namestring | nullrequired Job this quarantine applies to. \`null\` means the test is quarantined in every job. created\_atstring required UTC timestamp when the test was added to quarantine. source"manual" | "auto" How the test got quarantined: \`manual\` (user action) or \`auto\` (auto-quarantined). Enum: `manual` `auto` health\_status"healthy" | "flaky" | "broken" | nullrequired Health of the test, or \`null\` when it has no recent runs. is\_recoveredbooleanrequired True when recent runs of this test are healthy, suggesting the quarantine could be removed. totalintegerrequired Total number of quarantines matching the filters, across all pages. Example Response `{ "size": 0, "per_page": 0, "quarantined_tests": [ { "id": "string", "test_name": "string", "test_id": "string", "reason": "string", "branch": "string", "branch_name": "string", "pipeline_name": "string", "job_name": "string", "created_at": "2024-01-15T09:00:00Z", "source": "manual", "health_status": "healthy", "is_recovered": true } ], "total": 0 }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines" \ -H "Authorization: Bearer " Mark a test as quarantined [#](https://docs.mergify.com/api/test-insights/#add-ci-quarantine-ci-owner-repositories-repository-quarantines-post) ------------------------------------------------------------------------------------------------------------------------------------------------ POST `/ci/{owner}/repositories/{repository}/quarantines` Add a test to the CI Quarantine for a repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Request Body test\_namestringrequired The fully qualified name of the test that needs to be quarantined max length: 10000 reasonstringrequired Reason for the test being added to the quarantine max length: 10000 branchstring | null Branch name on which the test should be quarantined. If not specified, it will be quarantined on all branches. Responses 201 Successful Response idstring required The ID of the created quarantine Example Response `{ "id": "string" }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X POST "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "test_name": "string", "reason": "string", "branch": "string" }' Get a quarantined test [#](https://docs.mergify.com/api/test-insights/#get-quarantine-by-id-ci-owner-repositories-repository-quarantines-quarantine-id-get) ------------------------------------------------------------------------------------------------------------------------------------------------------------ GET `/ci/{owner}/repositories/{repository}/quarantines/{quarantine_id}` Retrieve a single quarantined test by its quarantine ID. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `quarantine_id` string required `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response idstring required Unique identifier of the quarantine record. test\_namestringrequired Fully qualified name of the quarantined test. test\_idstring required Stable identifier of the test, derived from its name. Identical across every quarantine of the same test and matches the \`test\_id\` filter on the list endpoint. reasonstringrequired Free-form reason recorded when the test was quarantined. branchstring | nullrequired Deprecated: use \`branch\_name\`. branch\_namestring | nullrequired Branch this quarantine applies to. \`null\` means the test is quarantined on every branch. pipeline\_namestring | nullrequired Pipeline this quarantine applies to. \`null\` means the test is quarantined in every pipeline. job\_namestring | nullrequired Job this quarantine applies to. \`null\` means the test is quarantined in every job. created\_atstring required UTC timestamp when the test was added to quarantine. source"manual" | "auto" How the test got quarantined: \`manual\` (user action) or \`auto\` (auto-quarantined). Enum: `manual` `auto` health\_status"healthy" | "flaky" | "broken" | nullrequired Health of the test, or \`null\` when it has no recent runs. is\_recoveredbooleanrequired True when recent runs of this test are healthy, suggesting the quarantine could be removed. Example Response `{ "id": "string", "test_name": "string", "test_id": "string", "reason": "string", "branch": "string", "branch_name": "string", "pipeline_name": "string", "job_name": "string", "created_at": "2024-01-15T09:00:00Z", "source": "manual", "health_status": "healthy", "is_recovered": true }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines/:quarantine_id" \ -H "Authorization: Bearer " Remove a quarantine [#](https://docs.mergify.com/api/test-insights/#remove-quarantine-by-id-ci-owner-repositories-repository-quarantines-quarantine-id-delete) --------------------------------------------------------------------------------------------------------------------------------------------------------------- DELETE `/ci/{owner}/repositories/{repository}/quarantines/{quarantine_id}` Remove a quarantine with its id Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `quarantine_id` string required `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Responses 200 Successful Response any 204 No content 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X DELETE "https://api.mergify.com/v1/ci/:owner/repositories/:repository/quarantines/:quarantine_id" \ -H "Authorization: Bearer " Get a single test stat as a time series [#](https://docs.mergify.com/api/test-insights/#ci-tests-stats) -------------------------------------------------------------------------------------------------------- GET `/ci/{owner}/repositories/{repository}/tests/stats/{stat}` Return one test stat with a window summary \`value\` and a per-day \`value\_over\_time\` series of failed executions. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `stat` "total\_tests" | "healthy\_tests" | "broken\_tests" | "flaky\_tests" | "failed\_executions" required `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `test_name` string\[\] The test name to filter on `test_name_exclude` string\[\] The test name to exclude `job_name` string\[\] The job name to filter on `job_name_exclude` string\[\] The job name to exclude `pipeline_name` string\[\] The pipeline name to filter on `pipeline_name_exclude` string\[\] The pipeline name to exclude `health_confidence` ("low" | "medium" | "high")\[\] The health confidence to filter on `health_confidence_exclude` ("low" | "medium" | "high")\[\] The health confidence to exclude `failed_executions_impact` ("low" | "medium" | "high")\[\] The failed executions impact to filter on `failed_executions_impact_exclude` ("low" | "medium" | "high")\[\] The failed executions impact to exclude Responses 200 Successful Response stat"total\_tests" | "healthy\_tests" | "broken\_tests" | "flaky\_tests" | "failed\_executions"required Enum: `total_tests` `healthy_tests` `broken_tests` `flaky_tests` `failed_executions` valueintegerrequired value\_over\_timeTestStatBucket\[\]required startstring required endstring required valueintegerrequired Example Response `{ "stat": "total_tests", "value": 0, "value_over_time": [ { "start": "2024-01-15T09:00:00Z", "end": "2024-01-15T09:00:00Z", "value": 0 } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/tests/stats/:stat" \ -H "Authorization: Bearer " Was this page helpful? Yes No Thanks for your feedback! --- # Statistics * * * Time to merge statistics for every queue [#](https://docs.mergify.com/api/statistics/#get-time-to-merge-stats-for-all-queues-and-partitions-endpoint-repos-owner-repository-stats-time-to-merge-get) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/time_to_merge` Deprecated Get the average time to merge statistics, in seconds, for all the queues in the repository Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `at` string Retrieve the time to merge at this timestamp: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. `branch` string The name of the branch Responses 200 Successful Response queuesTimeToMergePerQueue\[\]required The time to merge data for each queue queue\_namestringrequired The name of the queue time\_to\_mergeTimeToMergeResponserequired The time to merge data for the queue meannumber | nullrequired mediannumber | nullrequired Example Response `[ { "queues": [ {} ] } ]` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/time_to_merge" \ -H "Authorization: Bearer " Get the queue checks outcome for the repository [#](https://docs.mergify.com/api/statistics/#get-checks-outcome-repos-owner-repository-stats-merge-queue-checks-outcome-get) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/merge_queue_checks_outcome` Deprecated Statuses describing the state in which the pull requests have left the queue(s). Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsChecksOutcomeGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsQueueChecksOutcomerequired BASE\_BRANCH\_CHANGEDinteger The pull request base branch has changed BASE\_BRANCH\_MISSINGinteger The base branch does not exist anymore BATCH\_MAX\_FAILURE\_RESOLUTION\_ATTEMPTSinteger The maximum batch failure resolution attempts has been reached BATCH\_SCOPES\_CHANGEDinteger The batch has been recomposed because a pull request's scopes changed BRANCH\_UPDATE\_FAILEDinteger The pull request can't be updated for security reasons CHECKS\_FAILEDinteger The checks for the queued pull request have failed CHECKS\_INTERRUPTEDinteger The checks for the queued pull request were cancelled before producing a result CHECKS\_TIMEOUTinteger The checks for the queued pull request have timed out DROPPED\_BY\_BISECTION\_ELIMINATIONinteger The pull request was dropped untested when batch bisection isolated the failure to other pull requests CONFLICT\_WITH\_BASE\_BRANCHinteger The pull request conflicts with the base branch CONFLICT\_WITH\_PULL\_AHEADinteger The pull request conflicts with at least one pull request ahead in queue DRAFT\_PULL\_REQUEST\_CHANGEDinteger New commits have been added to the draft pull request that were not made by Mergify BATCH\_PULL\_REQUEST\_CLOSEDinteger The batch pull request has been closed INCOMPATIBILITY\_WITH\_BRANCH\_PROTECTIONSinteger The pull request cannot be checked because of an incompatibility with branch protections MERGE\_QUEUE\_RESETinteger The merge queue has been reset PR\_AHEAD\_DEQUEUEDinteger A pull request ahead in the queue has been dequeued BATCH\_AHEAD\_FAILEDinteger A pull request ahead in the queue failed to get merged BATCH\_AHEAD\_BRANCH\_EDITEDinteger The branch of a batch ahead in the queue was edited, so this batch has been recomposed on top of it PR\_CHECKS\_STOPPED\_BECAUSE\_MERGE\_QUEUE\_PAUSEinteger The checks have been interrupted because the merge queue is paused on this repository PR\_DEQUEUEDinteger Pull request has been dequeued PR\_DEQUEUED\_FROM\_PARTITIONinteger Pull request has been dequeued from a partition PR\_UNEXPECTEDLY\_FAILED\_TO\_MERGEinteger Pull request unexpectedly failed to get merged PR\_WITH\_HIGHER\_PRIORITY\_QUEUEDinteger A pull request with a higher priority has been queued PULL\_REQUEST\_UPDATEDinteger The pull request has been unexpectedly updated QUEUE\_RULE\_MISSINGinteger The queue rules are missing because of a configuration change SPECULATIVE\_CHECK\_NUMBER\_REDUCEDinteger The number of speculative checks, in the queue rules, has been reduced SUCCESSinteger Successfully merged the pull request PR\_MANUALLY\_MERGEDinteger The pull request has been manually merged DRAFT\_PULL\_REQUEST\_CREATION\_FAILEDinteger The draft pull request cannot be created DRAFT\_PULL\_REQUEST\_CREATION\_BRANCH\_NOT\_INDEXEDinteger The draft pull request cannot be created because GitHub has not indexed the branch yet CONFIGURATION\_CHANGEDinteger The configuration has changed UNPROCESSABLE\_PULL\_REQUESTinteger The pull request could not be processed by Mergify PR\_MANUALLY\_DEQUEUEDinteger The pull request has been manually removed from the queue STACK\_PREDECESSOR\_DEQUEUEDinteger The pull request has been dequeued because its stack predecessor was dequeued INTERMEDIATE\_RESULTS\_SKIPPEDinteger The pull request intermediate results have been skipped during batch promotion CHECKS\_RETRIEDinteger The checks have failed and are being retried SCHEDULED\_FREEZE\_STATUS\_CHANGEDinteger The batch has been split because a scheduled freeze changed the freeze status of its pull requests SCHEDULE\_BLOCKED\_AHEAD\_YIELDEDinteger A pull request ahead was waiting for its merge schedule, so it yielded its position to let ready pull requests merge first BASE\_REF\_ALIGNMENT\_TIMEOUTinteger The stacked pull request's base branch could not be retargeted onto the queue base branch and was dequeued GITHUB\_STACKED\_PULL\_REQUEST\_MERGE\_UNSUPPORTEDinteger The pull request is a GitHub-native stacked pull request, which GitHub does not allow merging through the API, and was dequeued GITHUB\_WORKFLOWS\_PERMISSION\_MISSINGinteger GitHub refused to write the pull request's workflow changes because Mergify lacks the \`workflows\` permission, and it was dequeued Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": {} } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/merge_queue_checks_outcome" \ -H "Authorization: Bearer " Get the count of queue checks outcomes [#](https://docs.mergify.com/api/statistics/#get-checks-outcome-by-interval-repos-owner-repository-stats-queues-checks-outcome-count-get) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/queues_checks_outcome_count` Statuses describing the state in which the pull requests have left the queue(s), grouped by time intervals. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsChecksOutcomeByIntervalGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsCheckOutcomeInInterval\[\]required startstring required endstring required check\_outcomestringrequired countintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues_checks_outcome_count" \ -H "Authorization: Bearer " Get the count of pull requests entering the queues [#](https://docs.mergify.com/api/statistics/#get-queues-pull-requests-entered-count-repos-owner-repository-stats-queues-entered-count-get) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/queues_entered_count` Queues pull requests entered by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsEnteredGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsEnteredInInterval\[\]required startstring required endstring required enteredintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues_entered_count" \ -H "Authorization: Bearer " Get the count of pull requests merged by queues [#](https://docs.mergify.com/api/statistics/#get-queues-pull-requests-merged-count-repos-owner-repository-stats-queues-merged-count-get) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/queues_merged_count` Queues pull requests merged by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsMergedGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsMergedInInterval\[\]required startstring required endstring required mergedintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues_merged_count" \ -H "Authorization: Bearer " Get the average CI runtime [#](https://docs.mergify.com/api/statistics/#get-average-ci-runtime-repos-owner-repository-stats-average-ci-runtime-get) ---------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/average_ci_runtime` Runtime of your CI running on queued pull requests by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsCIRuntimeGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsRuntimeInInterval\[\]required startstring required endstring required runtimenumberrequired sum\_runtimenumberrequired count\_runtimeintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/average_ci_runtime" \ -H "Authorization: Bearer " Get the idle queue time [#](https://docs.mergify.com/api/statistics/#get-average-idle-queue-time-repos-owner-repository-stats-idle-queue-time-get) --------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/idle_queue_time` Idle time spent in queue by the Pull Requests by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsIdleTimeGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsIdleTimeInInterval\[\]required startstring required endstring required idle\_capacitynumberrequired idle\_schedulenumberrequired idle\_freezenumberrequired ci\_runtimenumberrequired p95\_idle\_capacitynumberrequired p95\_idle\_schedulenumberrequired p95\_idle\_freezenumberrequired p95\_ci\_runtimenumberrequired max\_idle\_capacitynumberrequired max\_idle\_schedulenumberrequired max\_idle\_freezenumberrequired max\_ci\_runtimenumberrequired sum\_idle\_capacitynumberrequired sum\_idle\_schedulenumberrequired sum\_idle\_freezenumberrequired sum\_ci\_runtimenumberrequired count\_idleintegerrequired summaryIdleTimeSummaryrequired avg\_idle\_capacitynumberrequired avg\_idle\_schedulenumberrequired avg\_idle\_freezenumberrequired avg\_ci\_runtimenumberrequired p95\_idle\_capacitynumberrequired p95\_idle\_schedulenumberrequired p95\_idle\_freezenumberrequired p95\_ci\_runtimenumberrequired max\_idle\_capacitynumberrequired max\_idle\_schedulenumberrequired max\_idle\_freezenumberrequired max\_ci\_runtimenumberrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null, "summary": {} } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/idle_queue_time" \ -H "Authorization: Bearer " Get the queue time [#](https://docs.mergify.com/api/statistics/#get-total-queue-time-repos-owner-repository-stats-total-queue-time-get) ---------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/total_queue_time` Total time spent in queue by the Pull Requests by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsQueueTimeGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsQueueTimeInInterval\[\]required startstring required endstring required avg\_queue\_timenumberrequired max\_queue\_timenumberrequired min\_queue\_timenumberrequired sum\_queue\_timenumberrequired count\_queue\_timeintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/total_queue_time" \ -H "Authorization: Bearer " Get the queue size [#](https://docs.mergify.com/api/statistics/#get-queue-size-repos-owner-repository-stats-queue-size-get) ---------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/queue_size` Get the average, max and min queue size over the period by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsQueueSizeGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsQueueSizeInInterval\[\]required startstring required endstring required avg\_sizenumberrequired max\_sizeintegerrequired min\_sizeintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queue_size" \ -H "Authorization: Bearer " Get the number of running speculative checks [#](https://docs.mergify.com/api/statistics/#get-total-running-checks-repos-owner-repository-stats-running-speculative-checks-get) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/running_speculative_checks` Speculative checks running on queues by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsRunningChecksGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired statsRunningChecksInInterval\[\]required startstring required endstring required avg\_running\_checksnumberrequired max\_running\_checksintegerrequired min\_running\_checksintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/running_speculative_checks" \ -H "Authorization: Bearer " Get the checks batch size [#](https://docs.mergify.com/api/statistics/#get-stats-batch-size-repos-owner-repository-stats-batch-size-get) ----------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/batch_size` Batch size of the checks running on queues by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsBatchSizeGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsBatchSizeInInterval\[\]required startstring required endstring required avg\_batch\_sizenumberrequired max\_batch\_sizeintegerrequired min\_batch\_sizeintegerrequired sum\_batch\_sizeintegerrequired count\_batch\_sizeintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/batch_size" \ -H "Authorization: Bearer " Get batch bisection statistics [#](https://docs.mergify.com/api/statistics/#get-stats-batch-bisection-repos-owner-repository-stats-batch-bisection-get) -------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/batch_bisection` Statistics about bisection events in the merge queue Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response startedBisectionStartGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsBisectionStartInInterval\[\]required startstring required endstring required bisection\_countintegerrequired avg\_depthnumberrequired max\_depthintegerrequired avg\_batch\_size\_before\_splitnumberrequired completedBisectionEndGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsBisectionEndInInterval\[\]required startstring required endstring required bisection\_completed\_countintegerrequired culprit\_found\_countintegerrequired max\_failure\_reached\_countintegerrequired Example Response `{ "started": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ], "completed": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/batch_bisection" \ -H "Authorization: Bearer " Get the base refs in the repository [#](https://docs.mergify.com/api/statistics/#get-stats-branches-repos-owner-repository-stats-branches-get) ----------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/branches` Retrieve a list of base refs branches affected by queue activity Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response base\_refsstring\[\]required Example Response `{ "base_refs": [ "string" ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/branches" \ -H "Authorization: Bearer " Get the queue checks retries statistics [#](https://docs.mergify.com/api/statistics/#get-queue-checks-retries-repos-owner-repository-stats-checks-retries-get) --------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/checks_retries` Statistics about checks retries in the merge queue by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsChecksRetriesGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsChecksRetriesInInterval\[\]required startstring required endstring required total\_retriesintegerrequired sessions\_with\_retriesintegerrequired recoveredintegerrequired not\_recoveredintegerrequired recovery\_ratenumberrequired avg\_retry\_depthnumberrequired max\_retry\_depthintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/checks_retries" \ -H "Authorization: Bearer " Get the CI runs the merge queues started and wasted [#](https://docs.mergify.com/api/statistics/#get-ci-runs-repos-owner-repository-stats-ci-runs-get) ------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/ci_runs` CI runs the merge queues started, and the ones they tore down before a merge with the reason why, by intervals of time. A run is one check the queue started -- a draft pull request, or the queued pull request itself when it is checked in place -- counted once however many pull requests it carries. A merge the queue trusts without running CI is not a run. Divide \`started\` by the merged pull requests of \`queues\_merged\_count\` for the CI runs each merge costs. A draft run carries pull requests of several priority rules, so there is no priority rule filter. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsCIRunsGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired startedStartedCIRunsInInterval\[\]required startstring required endstring required startedintegerrequired wastedWastedCIRunsInInterval\[\]required startstring required endstring required reasonstringrequired countintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "started": null, "wasted": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/ci_runs" \ -H "Authorization: Bearer " Get the queue failure rate [#](https://docs.mergify.com/api/statistics/#get-queue-failure-rate-repos-owner-repository-stats-failure-rate-get) ---------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/failure_rate` Failure rate of pull requests in the merge queue by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsFailureRateGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsFailureRateInInterval\[\]required startstring required endstring required totalintegerrequired failuresintegerrequired failure\_ratenumberrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/failure_rate" \ -H "Authorization: Bearer " Get the number of batches saved by skip intermediate results [#](https://docs.mergify.com/api/statistics/#get-skip-intermediate-results-repos-owner-repository-stats-skip-intermediate-results-get) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/skip_intermediate_results` Number of batches merged without running their own speculative CI because a later batch containing their changes passed (skip\_intermediate\_results) — i.e. the speculative CI runs avoided — by intervals of time Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsSkipIntermediateResultsGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsSkipIntermediateResultsInInterval\[\]required startstring required endstring required batches\_savedintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/skip_intermediate_results" \ -H "Authorization: Bearer " Get PR exit reasons by interval [#](https://docs.mergify.com/api/statistics/#get-pr-exit-reasons-repos-owner-repository-stats-queues-pr-exit-reasons-get) ---------------------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/queues_pr_exit_reasons` Count of pull request queue-session exits by reason, grouped by time intervals. Each queue session (enter → leave) is counted once. A PR re-queued after failure appears in each session separately. Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `base_ref` string\[\] Base reference(s) of the pull requests `queue_name` string\[\] Name of the merge queue(s) for the pull requests `priority_rule_name` string\[\] Name of the priority rule(s) of the pull requests `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response groupsPrExitReasonGroupResponse\[\]required base\_refstringrequired queue\_namestringrequired priority\_rule\_namestring | nullrequired statsPrExitReasonInInterval\[\]required startstring required endstring required exit\_reasonstringrequired countintegerrequired Example Response `{ "groups": [ { "base_ref": "string", "queue_name": "string", "priority_rule_name": "string", "stats": null } ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues_pr_exit_reasons" \ -H "Authorization: Bearer " Get the queue names in the repository [#](https://docs.mergify.com/api/statistics/#get-stats-queues-repos-owner-repository-stats-queues-get) --------------------------------------------------------------------------------------------------------------------------------------------- GET `/repos/{owner}/{repository}/stats/queues` Retrieve a list of queue names affected by queue activity Authorization (any one of) Admin Application Key MergifyTokenBearerAuth GitHub Token Path Parameters `owner` string required The owner of the repository min length: 1 · max length: 40 · pattern: ^\[a-zA-Z0-9\\-\]+$ `repository` string required The name of the repository min length: 1 · max length: 100 · pattern: ^\[\\w\\-\\.\]+$ Query Parameters `start_at` string Get the stats from this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to 1 day before \`end\_at\`. `end_at` string Get the stats until this date: an ISO 8601 datetime with a UTC offset (e.g. \`2024-01-01T00:00:00Z\`); a Unix timestamp or a datetime without an offset is refused. Defaults to now. Responses 200 Successful Response queue\_namesstring\[\]required Example Response `{ "queue_names": [ "string" ] }` 403 Forbidden 404 Not found 409 Conflict 422 Unprocessable entity Example Request curl -X GET "https://api.mergify.com/v1/repos/:owner/:repository/stats/queues" \ -H "Authorization: Bearer " Was this page helpful? Yes No Thanks for your feedback! --- # API Usage * * * Mergify provides a RESTful API for integrating with your merge queues, CI Insights, and Workflow Automation. All API requests should be directed to: `https://api.mergify.com/v1` The API is entirely documented in the [API Reference](https://docs.mergify.com/api) . Authentication -------------- [Section titled Authentication](https://docs.mergify.com/api/usage/#authentication) The Mergify API supports three authentication methods, all using Bearer tokens: **Application Keys** (generated from your dashboard), **GitHub Personal Access Tokens**, and **Mergify User Tokens**. ### Creating an Application Key [Section titled Creating an Application Key](https://docs.mergify.com/api/usage/#creating-an-application-key) A key belongs to an organization, so start from the organization you want it to reach: 1. Open the [dashboard](https://dashboard.mergify.com/) and select the organization. 2. Go to **Settings → Developer → Application Keys**. 3. Click **Add Key**, name the key, and pick its scope. 4. Click **Create**. ![Create application keys](https://docs.mergify.com/_astro/application_keys.DM9iBqNb_Zrv59i.webp) The scope selector only appears if you are an admin of the GitHub organization. Everyone else creates `ci` keys, and creating, renaming, or deleting an `admin` key from an account that is not an org admin fails with `403`. The key appears once, in a banner above the list. Copy it before you leave the page: reloading does not bring it back, and there is no way to recover it. If you lose one, delete the key and create another. ![Application key token](https://docs.mergify.com/_astro/application_keys_token.DGEWhX4C_Z1up8lB.webp) ### Application Key Scopes [Section titled Application Key Scopes](https://docs.mergify.com/api/usage/#application-key-scopes) Application keys have two scopes, picked when you create the key: * `admin`: the whole API, except uploading results, setting [Merge Queue Scopes](https://docs.mergify.com/merge-queue/scopes) , and the mid-run flaky-detection and test-selection reads below, which need a `ci` key. * `ci`: uploading CI and test results, setting Merge Queue Scopes, and the reads a job makes while it runs: the list of [quarantined](https://docs.mergify.com/test-insights/quarantine) tests, and the [flaky-detection](https://docs.mergify.com/ci-insights/flaky-test-detection) and test-selection data the test framework integrations fetch mid-run. A `ci` key reaches nothing else in Test Insights. Browsing tests, their executions and their failures, and adding or removing a quarantine, are answered with `403` and need an `admin` key, a GitHub personal access token, or a user token. A `ci` key sits in CI configuration, where a build log or a workflow file can reach it, so it carries only what an unattended job needs. A key belongs to a GitHub account, not to a repository or to the person who created it. It works on every repository of that account and carries no GitHub repository role, so the [Features Permissions](https://docs.mergify.com/security#features-permissions) table does not restrict it. ### Using the API Key [Section titled Using the API Key](https://docs.mergify.com/api/usage/#using-the-api-key) With the provided API key, you’re set to make authenticated requests against the Mergify API. For example, to validate the authenticity of your token, you can retrieve your application’s information: curl -H "Accept: application/json" \ -H "Authorization: Bearer " \ https://api.mergify.com/v1/application Response: { "id": "e155518c-ca1b-443c-9be9-fe90fdab7345", "name": "my application", "scope": "ci", "account_scope": { "id": 123456, "login": "Mergifyio" }} The `scope` field tells you which of the two scopes above the key holds. ### Using a GitHub Personal Access Token [Section titled Using a GitHub Personal Access Token](https://docs.mergify.com/api/usage/#using-a-github-personal-access-token) As an alternative to application keys, you can authenticate to the Mergify API using a **GitHub Personal Access Token (PAT)** as a Bearer token. This is useful when integrating with tools that already have a GitHub token available, such as CI environments. You must have logged in to the [Mergify dashboard](https://dashboard.mergify.com/) at least once using GitHub OAuth before using this method. The PAT is only used to verify your GitHub identity: all permissions are based on your Mergify account, not the PAT’s scopes. **Accepted token formats:** * `ghp_*`: [classic personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) * `github_pat_*`: [fine-grained personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) * `gho_*`: GitHub OAuth user tokens Tokens issued to a GitHub App rather than to a user (`ghu_*`, `ghs_*`) are not accepted. A job that only has an app installation token needs an application key instead. Example: curl -H "Accept: application/json" \ -H "Authorization: Bearer " \ https://api.mergify.com/v1/repos///queues ### Using a Mergify User Token [Section titled Using a Mergify User Token](https://docs.mergify.com/api/usage/#using-a-mergify-user-token) Mergify also issues user tokens of its own, recognizable by their `mut_` prefix and obtained through the OAuth 2.0 device authorization grant. Run [`mergify auth login`](https://docs.mergify.com/cli/usage#authentication) to get one. Send it as a Bearer token, the same way as the credentials above. A user token identifies the person it was issued to. It reaches exactly what its owner’s dashboard session reaches, and nothing on GitHub directly, so holding one grants no access its owner does not already have. ### Revoking an Application Key [Section titled Revoking an Application Key](https://docs.mergify.com/api/usage/#revoking-an-application-key) If, for any reason, you need to revoke an application key: 1. Open **Settings → Developer → Application Keys** in the [dashboard](https://dashboard.mergify.com/) . 2. Click the delete icon on the key’s row, and confirm. ![Delete application key](https://docs.mergify.com/_astro/application_keys_delete.DraclZUN_Z24LOrB.webp) The key is removed, revoking any access it provided. Pagination ---------- [Section titled Pagination](https://docs.mergify.com/api/usage/#pagination) Endpoints that return lists of items use cursor-based pagination. Paginated responses include a `Link` header ([RFC 5988](https://www.rfc-editor.org/rfc/rfc5988) ) with URLs for navigating between pages. **Query parameters:** * `per_page`: Number of items per page, from 1 to 100. Most paginated endpoints default to 10. On others, pagination is opt-in: they have no default and return the whole list in a single response until you pass `per_page`. Where pagination is opt-in, the endpoint’s entry in the [API Reference](https://docs.mergify.com/api) says so. * `cursor`: Opaque cursor for the current page. Extract this from the `Link` header; do not construct it manually. **Link header example:** Link: //logs?cursor=abc&per_page=20>; rel="next", //logs?cursor=def&per_page=20>; rel="prev" The `Link` header may include the following relations: * `next`: The next page of results * `prev`: The previous page of results Each relation appears only when that page exists: `next` is absent on the last page, `prev` on the first. The two are independent, and a middle page carries both. When neither applies — a result set that fits on a single page — the `Link` header is omitted entirely. To iterate through all pages, follow the `rel="next"` link until it is no longer present in the response. To get back to the first page, call the endpoint again without a `cursor`. Each link carries the query parameters of the request it came from, so following one keeps the filters you set. On an endpoint whose `start` and `end` default to a window ending at the current time, the resolved bounds are pinned into the links too: iterating with `rel="next"` keeps serving the window the first page was built from, instead of resolving a fresh one against a later clock and dropping the oldest items on the way. A bound you passed yourself is echoed back as you sent it. Error Handling -------------- [Section titled Error Handling](https://docs.mergify.com/api/usage/#error-handling) The API uses standard HTTP status codes to indicate the success or failure of a request. | Status Code | Meaning | Description | | --- | --- | --- | | `200` | OK | The request succeeded. | | `201` | Created | The resource was created. | | `204` | No Content | The request succeeded and the response has no body. | | `403` | Forbidden | The credential was refused, or is valid but lacks permission for this resource. | | `404` | Not Found | The requested resource does not exist. | | `409` | Conflict | The request conflicts with the current state of the resource. | | `422` | Unprocessable Entity | The request body or parameters are invalid. | Was this page helpful? Yes No Thanks for your feedback! [Edit this page on GitHub](https://github.com/Mergifyio/docs/edit/main/src/content/docs/api/usage.mdx) --- # `batch_max_wait_time` defaults to 30s Workflow Automation `batch_max_wait_time` defaults to 30s ===================================== January 6, 2022 Change the default value for `batch_max_wait_time` to `30s`. More in Workflow Automation --------------------------- [Pull requests from a fork can no longer be rebased September 29, 2026](https://docs.mergify.com/changelog/2026-09-29-pull-requests-from-a-fork-can-no-longer-be-rebased/) [The configuration editor tells you which sections your enabled products will never read September 23, 2026](https://docs.mergify.com/changelog/2026-09-23-the-configuration-editor-tells-you-which-sections-your-enabled-products-will-never-read/) [Head branch updates stay inside your repository and its forks September 8, 2026](https://docs.mergify.com/changelog/2026-09-08-head-branch-updates-stay-inside-your-repository-and-its-forks/) [The github\_actions action is deprecated July 29, 2026](https://docs.mergify.com/changelog/2026-07-29-the-github-actions-action-is-deprecated/) Was this page helpful? Yes No Thanks for your feedback! [Edit this page on GitHub](https://github.com/Mergifyio/docs/edit/main/src/content/docs/changelog/2022-01-06-batch-max-wait-time-defaults-to-30s.mdx) --- # Browser Extensions * * * Why Use the Browser Extensions? ------------------------------- [Section titled Why Use the Browser Extensions?](https://docs.mergify.com/browser-extensions/#why-use-the-browser-extensions) The Chrome and Firefox extensions inject a small Mergify panel into every GitHub pull request you open. The panel surfaces the most common actions without typing [commands](https://docs.mergify.com/commands) and shows Mergify context (queue state, stack position) directly in the pull request. Use them when you want to: * Enqueue a pull request as soon as you review it. * Quickly dequeue without context switching. * See at a glance whether the pull request is already in one of your queues. * See a [stack’s](https://docs.mergify.com/stacks) chain and revision history without opening the CLI. * Read the timestamps in Merge Queue reports in your own timezone instead of UTC. Locate the Official Download Links ---------------------------------- [Section titled Locate the Official Download Links](https://docs.mergify.com/browser-extensions/#locate-the-official-download-links) The dashboard keeps the canonical links to the Chrome Web Store and Firefox Add-ons listing so you always grab the signed builds. 1. Sign in to the [Mergify dashboard](https://dashboard.mergify.com/) . 2. Open **Settings → Integrations** and pick the **Browser** category. 3. On the **Chrome Extension** or **Firefox Add-On** card, click **Install**. The button reads **Installed** when the browser you are using already has it. **Merge Queue → Deployment → Browser Extension** carries the same two links, labeled **Add to Chrome** and **Add to Firefox**, next to a summary of what the panel adds to a pull request. ![The Browser category of the Mergify Integrations page, with the Chrome Extension and Firefox Add-On cards](https://docs.mergify.com/_astro/list.BHLUSB6S_pOEDa.webp) Install on Chrome or Firefox ---------------------------- [Section titled Install on Chrome or Firefox](https://docs.mergify.com/browser-extensions/#install-on-chrome-or-firefox) ### Chrome [Section titled Chrome](https://docs.mergify.com/browser-extensions/#chrome) 1. Click **Install** on the Chrome Extension card, or **Add to Chrome** on the Deployment page. 2. Confirm the permissions in the Chrome Web Store dialog. ### Firefox [Section titled Firefox](https://docs.mergify.com/browser-extensions/#firefox) 1. Click **Install** on the Firefox Add-On card, or **Add to Firefox** on the Deployment page. 2. Approve the requested permissions in the Firefox Add-ons prompt. Merge Queue Controls -------------------- [Section titled Merge Queue Controls](https://docs.mergify.com/browser-extensions/#merge-queue-controls) After installation, reload any pull request on GitHub. A Mergify panel appears above the GitHub merge box, with a button for each command you would otherwise leave as a comment: * **Queue** and **Requeue** both run [`queue`](https://docs.mergify.com/commands/queue) to put the pull request into the merge queue. * **Dequeue** runs [`dequeue`](https://docs.mergify.com/commands/dequeue) to take it back out. * **Refresh** runs [`refresh`](https://docs.mergify.com/commands/refresh) to re-evaluate the pull request against your configuration. * **Rebase branch** and **Update branch** run [`rebase`](https://docs.mergify.com/commands/rebase) and [`update`](https://docs.mergify.com/commands/update) to bring the pull request up to date with its base branch. Two links next to the buttons open the pull request’s Mergify event history and the merge queue it sits in. ![Mergify browser extension panel injected into a GitHub pull request](https://docs.mergify.com/_astro/pr.7r-Uqlep_X5qt5.webp) Timestamps in Your Timezone --------------------------- [Section titled Timestamps in Your Timezone](https://docs.mergify.com/browser-extensions/#timestamps-in-your-timezone) The extension rewrites the UTC timestamps in Mergify’s Merge Queue reports into your browser’s timezone, so the times already match your local clock. The Mergify engine writes those timestamps in UTC so a report reads the same way for everyone, wherever they are. Without the extension, you have to convert each timestamp in your head to tell whether a pull request entered the queue during your workday, or when it is expected to merge. There is nothing to set up: the extension follows your browser, so the times stay correct when you travel or switch machines. Hovering a converted timestamp reveals the original UTC value, so the source time is never lost when you compare notes with a teammate in another timezone. The extension only rewrites Mergify’s own comments and leaves the rest of the pull request as GitHub renders it. Stacks Panel ------------ [Section titled Stacks Panel](https://docs.mergify.com/browser-extensions/#stacks-panel) For repositories using [Stacks](https://docs.mergify.com/stacks) , the extension renders the Mergify Stacks panel inside the pull request. It shows the full chain of stacked PRs, highlights where the current PR sits, and includes the [revision-history](https://docs.mergify.com/stacks/reviewing#revision-history) timeline so you can see how each commit evolved across pushes without leaving GitHub. ![Mergify Stacks panel with the stack and its revision history timeline on a pull request](https://docs.mergify.com/_astro/stacks-revision-history.CB0A_gtO_ZjxaiO.webp) Was this page helpful? Yes No Thanks for your feedback! [Edit this page on GitHub](https://github.com/Mergifyio/docs/edit/main/src/content/docs/browser-extensions.mdx) --- # `strict` mode removed Workflow Automation `strict` mode removed ===================== January 12, 2022 Remove deprecated `strict` mode on the `merge` action. More in Workflow Automation --------------------------- [Pull requests from a fork can no longer be rebased September 29, 2026](https://docs.mergify.com/changelog/2026-09-29-pull-requests-from-a-fork-can-no-longer-be-rebased/) [The configuration editor tells you which sections your enabled products will never read September 23, 2026](https://docs.mergify.com/changelog/2026-09-23-the-configuration-editor-tells-you-which-sections-your-enabled-products-will-never-read/) [Head branch updates stay inside your repository and its forks September 8, 2026](https://docs.mergify.com/changelog/2026-09-08-head-branch-updates-stay-inside-your-repository-and-its-forks/) [The github\_actions action is deprecated July 29, 2026](https://docs.mergify.com/changelog/2026-07-29-the-github-actions-action-is-deprecated/) Was this page helpful? Yes No Thanks for your feedback! [Edit this page on GitHub](https://github.com/Mergifyio/docs/edit/main/src/content/docs/changelog/2022-01-12-strict-mode-removed.mdx) --- # Mergify Billing System * * * This page explains how Mergify’s contributor-based billing works and how to read your invoice. Contributor-Based Billing ------------------------- [Section titled Contributor-Based Billing](https://docs.mergify.com/billing/#contributor-based-billing) Many enterprise solutions charge per user, irrespective of actual usage. At Mergify, we firmly believe in billing you only for what you actively use. This is why our billing system operates on the principle of contributors. Here’s how it works: * A contributor is any user who **contributes commits to a pull request**, either by opening it or by pushing new commits to it. Other activity, such as reviewing, commenting on, closing, or reopening a pull request, does not make someone a contributor. * Bot accounts are never contributors. A GitHub App or bot user that opens a pull request or pushes to one, such as a dependency updater, is skipped. So are `web-flow`, the account GitHub attributes web-editor commits to, and accounts that have since been deleted. Only real user accounts are counted. * Each user is counted **only once**, even if they contribute to pull requests across multiple repositories. * The system uses a 30-day sliding window. A user is counted as a contributor for 30 days after they open a pull request or push commits to one. After that period, if they make no further contributions, they are no longer considered active for billing purposes. * Usage is prorated to the day: if a contributor is seen active during 48 days, the system only bills for precisely 48 days, not 2 entire months. ### Estimating Contributors [Section titled Estimating Contributors](https://docs.mergify.com/billing/#estimating-contributors) If you don’t know the number of contributors that Mergify might count, you can use [this script](https://docs.mergify.com/mergify-count-contributors.py) to estimate the number of contributors over the last 30 days. 1. Go to [https://github.com/settings/tokens](https://github.com/settings/tokens) (or the equivalent page on your GitHub Enterprise Server installation, at `https:///settings/tokens`) to create a token. The token must have the permissions to access the repository (read permission is enough); 2. Export the token as an environment variable with `export GITHUB_TOKEN=`; 3. Install [`requests`](https://pypi.python.org/pypi/requests) on your system by running `python3 -m pip install requests`; 4. Run the script with `python3 mergify-count-contributors.py etc`, passing the list of repositories where Mergify will be deployed. Use the full repository URLs, including the host, so the script can reach the right API endpoint (for example `https://github.com/org/repo` for GitHub.com or `https://github.example.com/org/repo` for GitHub Enterprise Server). The script will run and print its progress. It can take several minutes for the script to complete depending on the number of repositories scanned and the number of active pull requests they have. Annual Subscription ------------------- [Section titled Annual Subscription](https://docs.mergify.com/billing/#annual-subscription) Mergify does not require an annual subscription (except for the Enterprise plan), but offers a large discount if you buy users in advance for a 12-month period. An annual subscription allows you to buy a base number of seats (users) per product at the start of the year. If your usage goes beyond the pre-purchased seats, additional seats are billed monthly, prorated to the exact day of use. For example, let’s say you have purchased an annual license for 100 users. If your number of users increases to 110 users during 45 days, you will be invoiced for 10 extra users over 45 days. Checking Current Usage ---------------------- [Section titled Checking Current Usage](https://docs.mergify.com/billing/#checking-current-usage) You can check your current usage on the [Plan page](https://dashboard.mergify.com/settings/plan) of the Mergify dashboard, under **Settings → Plan**. It lists each product you use in a table, with its repository count and its number of active contributors: | Product | Repositories | Active contributors | | --- | --- | --- | | Merge Queue | 10 repositories | 25 contributors | | CI Insights | 5 repositories | 15 contributors | | Workflow Automation | 10 repositories | 25 contributors | The counts above are examples. If you are a billing manager, the table has an **On-demand Usage** column showing what you are billed monthly on top of your plan. On a yearly subscription, it also has a **Committed** column showing the seats you pre-purchased. On some plans the third column is headed **Collaborators** instead. It counts everyone with access to a repository, rather than only the people who contributed to it. Both counts are clickable: the repository count takes you to your repositories list, and the contributor count opens the list of people counted for that product. Switching or Cancelling Plans ----------------------------- [Section titled Switching or Cancelling Plans](https://docs.mergify.com/billing/#switching-or-cancelling-plans) If you wish to switch between plans or cancel your subscription, [please contact our customer support](mailto:support@mergify.com) . They’ll guide you through the process and ensure a smooth transition. When you cancel, your subscription stays active until the end of the billing period you already paid for, and it does not renew. You may still receive one last invoice on that final day (see [Final Invoice After Cancellation](https://docs.mergify.com/billing/#3-final-invoice-after-cancellation) below). Understanding Your Invoice -------------------------- [Section titled Understanding Your Invoice](https://docs.mergify.com/billing/#understanding-your-invoice) A single invoice usually mixes two things: an adjustment for the period that just ended, and the charge for the period that is starting. The adjustment is there because the number of contributors Mergify counts can change any day. Cancelling your subscription produces one more invoice, which works differently and is covered last. ### 1\. **Real-time User Adjustment** [Section titled 1. Real-time User Adjustment](https://docs.mergify.com/billing/#1-real-time-user-adjustment) Mergify keeps the number of seats on your subscription in step with the number of contributors it counts. Every time that count changes, the adjustment is prorated: you are credited for the seats you had already paid for over the rest of the period, then charged for the new count over those same days. Both lines show up on your next invoice, labeled “unused time” and “remaining time” by our payment provider, so only the difference between them changes your total. ### 2\. **Upcoming Period Charge** [Section titled 2. Upcoming Period Charge](https://docs.mergify.com/billing/#2-upcoming-period-charge) The rest of the invoice charges the period that is about to start, based on your user count on the day it is issued. If that count changes during the period, the next invoice carries the same kind of adjustment. ### A Worked Example [Section titled A Worked Example](https://docs.mergify.com/billing/#a-worked-example) Say `example-org` is billed on the 1st of each month at $10 per user per month and has 20 contributors. Two more contributors push commits on April 16th, halfway through the period. The invoice issued on May 1st then reads: | Line | Period | Amount | | --- | --- | --- | | Unused time on 20 users | Apr 16 – May 1 | \-$100.00 | | Remaining time on 22 users | Apr 16 – May 1 | $110.00 | | 22 users | May 1 – Jun 1 | $220.00 | | **Total** | | **$230.00** | The first two lines are the real-time user adjustment: half of April is credited back at the old count, and the same half is re-charged at the new one. The $10 difference is what the two extra contributors cost for the time they were counted. The third line is the upcoming period, at the count you have on the day the invoice is issued. ### 3\. **Final Invoice After Cancellation** [Section titled 3. Final Invoice After Cancellation](https://docs.mergify.com/billing/#3-final-invoice-after-cancellation) When you cancel your subscription, it stays active until the end of the billing period you already paid for, then ends without renewing. You may still receive one last invoice dated on that final day. That last invoice covers your final billing period, not a renewal. It collects the [real-time user adjustments](https://docs.mergify.com/billing/#1-real-time-user-adjustment) described above: when your user count changes mid-period, the prorated difference is only settled on the next invoice, which for a cancelled subscription is the final one, issued when the period ends. So if your team grew during your last month, that growth is billed on the day your subscription ends. Once you pay it, you won’t be charged again. By understanding how your invoices are built, you can more easily interpret and anticipate how changes in your contributors influence your Mergify charges. Was this page helpful? Yes No Thanks for your feedback! [Edit this page on GitHub](https://github.com/Mergifyio/docs/edit/main/src/content/docs/billing.mdx) --- # Changelog 2026 ---- ### Oct 5 ### [Fix quarantined tests with AI](https://docs.mergify.com/changelog/2026-10-05-fix-quarantined-tests-with-ai/) Hand a quarantined test to Claude Code or Cursor with a ready-made prompt to fix it. Test Insights ### [See how many CI runs each merged pull request costs](https://docs.mergify.com/changelog/2026-10-05-see-how-many-ci-runs-each-merged-pull-request-costs/) The Merge Queue Stats page now shows how many CI runs the queue starts for each pull request it merges, and why the runs that led to no merge were thrown away. Merge Queue ### Sep 29 ### [`autosquash` has been removed](https://docs.mergify.com/changelog/2026-09-29-autosquash-has-been-removed/) Configurations that still set \`autosquash\` no longer validate. Deprecations ### [Filter quarantined tests by health on Mitigation](https://docs.mergify.com/changelog/2026-09-29-filter-quarantined-tests-by-health-on-mitigation/) Test Insights › Mitigation: filter the quarantined tests by health — find the ones that have recovered and release them from quarantine in one action. Test Insights ### [Know when a queued pull request merged without landing anything](https://docs.mergify.com/changelog/2026-09-29-know-when-a-queued-pull-request-merged-without-landing-anything/) The merge queue now flags a pull request that merged without changing the base branch, instead of leaving it looking like it shipped. Merge Queue ### [Pull requests from a fork can no longer be rebased](https://docs.mergify.com/changelog/2026-09-29-pull-requests-from-a-fork-can-no-longer-be-rebased/) The rebase action and the @mergifyio rebase command now fail on a pull request that comes from a fork. Use update instead. Workflow AutomationDeprecations ### [Remove several tests from quarantine at once, from the Mitigation page](https://docs.mergify.com/changelog/2026-09-29-remove-several-tests-from-quarantine-at-once-from-the-mitigation-page/) Test Insights › Mitigation: select several quarantined tests and remove them from quarantine in one action, directly from the list of quarantined tests. Test Insights ### [The merge queue no longer rebases fork pull requests on behalf of an account](https://docs.mergify.com/changelog/2026-09-29-the-merge-queue-no-longer-rebases-fork-pull-requests-on-behalf-of-an-account/) A queue rule that pairs update\_method: rebase with update\_bot\_account now refuses pull requests that come from a fork. Merge QueueDeprecations ### Sep 23 ### [`allow_queue_branch_edit` is deprecated](https://docs.mergify.com/changelog/2026-09-23-allow-queue-branch-edit-is-deprecated/) The \`allow\_queue\_branch\_edit\` queue rule option is deprecated and will be removed after December 31, 2026. Merge Queue ### [Jinja2 templating stops working on October 31, 2026](https://docs.mergify.com/changelog/2026-09-23-jinja2-templating-stops-working-on-october-31-2026/) Jinja2 expressions in your Mergify configuration stop working on October 31, 2026; plain {{ variable }} placeholders keep working. DeprecationsRules ### [Pick a condition's scope from the repository's scopes](https://docs.mergify.com/changelog/2026-09-23-pick-a-conditions-scope-from-the-repositorys-scopes/) In the dashboard's condition editor, a condition on scope now offers the scopes declared in the repository's configuration instead of a free text field; a scope that is not declared stays editable and is discreetly marked. Merge QueueMerge Protections ### [The configuration editor tells you which sections your enabled products will never read](https://docs.mergify.com/changelog/2026-09-23-the-configuration-editor-tells-you-which-sections-your-enabled-products-will-never-read/) The Summary panel of the configuration editor, the Configuration changed check on a configuration pull request, and mergify config simulate now warn when a section of .mergify.yml (pull\_request\_rules, merge\_protections, queue\_rules) is never evaluated because the product that runs it is not activated on the repository — with a link to activate it. Workflow AutomationMerge ProtectionsMerge Queue ### Sep 11 **Enterprise 8.17.2** released for self-hosted ### Sep 8 ### [Datadog integration: four merge queue metrics are being retired](https://docs.mergify.com/changelog/2026-09-08-datadog-integration-four-merge-queue-metrics-are-being-retired/) The operational Datadog metrics are retired in favour of the mergify.queue.\* set shipped in July. Two have a renamed counterpart, two have none. DeprecationsIntegrations ### [Head branch updates stay inside your repository and its forks](https://docs.mergify.com/changelog/2026-09-08-head-branch-updates-stay-inside-your-repository-and-its-forks/) The update, rebase and squash actions now refuse to write a head branch that lives in a repository yours was forked from. Workflow Automation ### Sep 4 ### [Pin a deployment condition to the app that deployed](https://docs.mergify.com/changelog/2026-09-04-pin-a-deployment-condition-to-the-app-that-deployed/) \`deployment-success\` and \`deployment-failure\` now accept the qualified \`@/\` form, so a rule can require an environment be deployed by one specific app. Rules ### Aug 25 ### [Clearer reason when the merge queue can't create the draft pull request](https://docs.mergify.com/changelog/2026-08-25-clearer-reason-when-the-merge-queue-cant-create-the-draft-pull-request/) The dequeue reason now carries GitHub's own refusal message, including the repository rule that blocked the push. Merge Queue ### [Pagination drops the first and last links](https://docs.mergify.com/changelog/2026-08-25-pagination-drops-the-first-and-last-links/) Paginated API responses now advertise only next and prev, and omit the Link header entirely when a page has neither. API ### [Per-lane check capacity for dynamic scopes](https://docs.mergify.com/changelog/2026-08-25-per-lane-check-capacity-for-dynamic-scopes/) Set a single speculative-check budget that applies to every scope, so dynamic scope sets get per-lane capacity without listing scope names. Merge Queue ### [Repository badge API removed](https://docs.mergify.com/changelog/2026-08-25-repository-badge-api-removed/) The deprecated /v1/badges/\* endpoints are gone; a Mergify badge embedded in a README no longer renders. API ### Aug 18 **Enterprise 8.17.1** released for self-hosted ### Aug 12 ### [Merge GitHub stacked pull requests with the merge queue](https://docs.mergify.com/changelog/2026-08-12-merge-github-stacked-pull-requests-with-the-merge-queue/) Queue any member of a GitHub-native stacked pull request and Mergify merges it, in order, through GitHub's merge API. Merge Queue ### Aug 11 ### [Author-run commands now require a fork pull request](https://docs.mergify.com/changelog/2026-08-11-author-run-commands-now-require-a-fork-pull-request/) The default restrictions for update, rebase, squash and refresh now let the pull request author run them only on pull requests coming from a fork. Rules ### [New from-fork condition attribute](https://docs.mergify.com/changelog/2026-08-11-new-from-fork-condition-attribute/) Conditions can now match on whether a pull request comes from a fork. Rules ### Jul 30 **Enterprise 8.17.0** released for self-hosted ### Jul 29 ### [Label pull requests while the merge queue checks them](https://docs.mergify.com/changelog/2026-07-29-label-pull-requests-while-the-merge-queue-checks-them/) A new \`checking\_label\` option labels a pull request for the whole time the merge queue is checking it. Merge Queue ### [The github\_actions action is deprecated](https://docs.mergify.com/changelog/2026-07-29-the-github-actions-action-is-deprecated/) The github\_actions workflow automation action is deprecated and will be removed on 31 March 2027. Trigger your workflows from GitHub Actions directly with on: pull\_request, workflow\_dispatch, or repository\_dispatch instead. Workflow AutomationDeprecations ### Jul 24 ### [Automatic flaky test detection and prevention](https://docs.mergify.com/changelog/2026-07-24-automatic-flaky-test-detection-and-prevention/) Mergify's test framework plugins now automatically rerun your tests to catch new flaky tests before they merge and surface existing flaky or broken tests on your default branch — all within a CI budget you control. Test Insights ### [Automatic self-hosted runner tracking](https://docs.mergify.com/changelog/2026-07-24-automatic-self-hosted-runner-tracking/) Self-hosted runner and queue metrics now populate automatically, with no configuration required. CI Insights ### [Avg, P95, and Max in the Merge Queue Time Breakdown](https://docs.mergify.com/changelog/2026-07-24-avg-p95-and-max-in-the-merge-queue-time-breakdown/) The Merge Queue Stats page's Time Breakdown now lets you switch each queued-time component between average, 95th percentile, and max. Merge Queue ### [New "Batches Saved" merge queue statistic](https://docs.mergify.com/changelog/2026-07-24-new-batches-saved-merge-queue-statistic/) The merge queue Statistics page now shows how many CI runs skip\_intermediate\_results saved — the number of batches merged without running their own speculative CI. Merge Queue ### [See what a queued pull request is waiting on](https://docs.mergify.com/changelog/2026-07-24-see-what-a-queued-pull-request-is-waiting-on/) The merge queue now shows which queued pull requests a pull request depends on, so its position in the queue is explained. Merge Queue ### Jul 20 ### [Direct Merge for scope-unaffected pull requests](https://docs.mergify.com/changelog/2026-07-20-direct-merge-for-scope-unaffected-pull-requests/) A queued pull request that is behind the base branch only by merges touching other scopes is now merged immediately, with no draft pull request and no merge queue CI run. Merge Queue ### Jul 17 ### [Declare merge queue barrier files in your configuration](https://docs.mergify.com/changelog/2026-07-17-declare-merge-queue-barrier-files-in-your-configuration/) You can now mark files that impact every scope directly in your Mergify configuration, so any pull request touching them runs alone in the merge queue. Merge Queue ### [Merge queue stats metrics and dashboard in Datadog](https://docs.mergify.com/changelog/2026-07-17-merge-queue-stats-metrics-and-dashboard-in-datadog/) The Datadog integration now ships 19 new mergify.queue.\* metrics covering merge queue throughput, queue health, and performance, plus an out-of-the-box dashboard. IntegrationsMerge Queue ### Jul 8 ### [CI & Test Insights stats now available in the public API](https://docs.mergify.com/changelog/2026-07-08-ci-test-insights-stats-now-available-in-the-public-api/) The test, runner, and CI queue stats endpoints are now part of Mergify's public REST API, each returning a window summary value plus a per-day time series. CI InsightsTest Insights ### [commit\_message\_template is deprecated — use commit\_message\_format](https://docs.mergify.com/changelog/2026-07-08-commit-message-template-is-deprecated-use-commit-message-format/) The commit\_message\_template setting is deprecated in favor of the declarative commit\_message\_format and will be removed on September 30, 2026. Deprecations ### [Dequeue a pull request from the merge queue](https://docs.mergify.com/changelog/2026-07-08-dequeue-a-pull-request-from-the-merge-queue/) Manually remove a queued pull request from the merge queue from the dashboard, with a confirmation dialog showing the impact. Merge Queue ### [Mark a pull request as impacting all CI scopes](https://docs.mergify.com/changelog/2026-07-08-mark-a-pull-request-as-impacting-all-ci-scopes/) Report a pull request as impacting every CI scope so it serializes the merge queue, instead of enumerating every target. Merge Queue ### [Scopes and batch lineage in queue event logs](https://docs.mergify.com/changelog/2026-07-08-scopes-and-batch-lineage-in-queue-event-logs/) Merge queue check events now carry the batch's scopes and parent batch ids (plus a batch\_id on leave), so you can reconstruct check history from the event logs alone. Merge Queue ### [skip\_intermediate\_results now works in parallel merge queue mode](https://docs.mergify.com/changelog/2026-07-08-skip-intermediate-results-now-works-in-parallel-merge-queue-mode/) The skip\_intermediate\_results option, previously serial-only, now also speeds up merges in parallel mode within each scope's dependency chain. Merge Queue ### [Trace a restarted batch back to its previous attempt](https://docs.mergify.com/changelog/2026-07-08-trace-a-restarted-batch-back-to-its-previous-attempt/) The merge queue activity log now links a restarted batch to the previous batch it retried. Merge Queue ### Jun 29 ### [Mention assignees and approvers in comment, review, and close messages](https://docs.mergify.com/changelog/2026-06-29-mention-assignees-and-approvers-in-comment-review-and-close-messages/) The comment, review, and close actions can now reference a pull request's assignees and approvers as ready-to-use @-mentions in their messages. Workflow Automation ### [Merge queues use an automatic checks timeout by default](https://docs.mergify.com/changelog/2026-06-29-merge-queues-use-an-automatic-checks-timeout-by-default/) Merge queues now default to an automatically computed checks timeout based on each queue's recent CI runtime. Merge Queue ### [Safe templating for backport and copy titles & bodies](https://docs.mergify.com/changelog/2026-06-29-safe-templating-for-backport-and-copy-titles-bodies/) The copy and backport actions' title and body now use Mergify's safe {{ variable }} templating, and Jinja2 expressions in these fields are deprecated. Workflow Automation ### [Safe templating for GitHub Actions workflow inputs](https://docs.mergify.com/changelog/2026-06-29-safe-templating-for-github-actions-workflow-inputs/) Workflow-dispatch inputs in the github\_actions action now use safe {{ variable }} templating, with raw Jinja2 deprecated. Workflow Automation ### Jun 19 ### [Built-in author and merger options for assignee fields](https://docs.mergify.com/changelog/2026-06-19-built-in-author-and-merger-options-for-assignee-fields/) The assign, copy, and backport actions now accept {{ author }} (and {{ merged\_by }} for copy/backport) as named, built-in options for their assignee lists. Rules ### [Dynamic merge queue batch size](https://docs.mergify.com/changelog/2026-06-19-dynamic-merge-queue-batch-size/) Configure batch\_size as a {min, max} range and the merge queue scales batch size automatically — small when quiet, larger to absorb backlog. Merge Queue ### [Impersonate the pull request author with a static `{{ author }}` bot account](https://docs.mergify.com/changelog/2026-06-19-impersonate-the-pull-request-author-with-a-static-author-bot-account/) \`{{ author }}\` is now a static \`bot\_account\` value that impersonates the pull request author in every action and queue rule, accepted anywhere. Rules ### [Merge protections honor GitHub's "require approval of most recent push"](https://docs.mergify.com/changelog/2026-06-19-merge-protections-honor-githubs-require-approval-of-most-recent-push/) Mergify now respects GitHub's "Require approval of the most recent push" branch-protection option when evaluating merge protections. Merge Protections ### [Queue or requeue a pull request with a checkbox](https://docs.mergify.com/changelog/2026-06-19-queue-or-requeue-a-pull-request-with-a-checkbox/) Queue or requeue a pull request by ticking a checkbox in the Mergify status comment, without typing a command. Merge Queue ### [Reference the pull request author in conditions with {{ author }}](https://docs.mergify.com/changelog/2026-06-19-reference-the-pull-request-author-in-conditions-with-author/) Rule conditions now accept {{ author }} as a built-in value for matching an attribute against the pull request author. Rules ### [Self-hosted Runners: Fleet & queue metrics](https://docs.mergify.com/changelog/2026-06-19-self-hosted-runners-fleet-queue-metrics/) A capacity view of your self-hosted runner fleet — utilization, saturation, active vs. available runners, and queue-wait time broken down by the labels jobs request. CI Insights ### [Slack notifications for quarantined tests](https://docs.mergify.com/changelog/2026-06-19-slack-notifications-for-quarantined-tests/) Mergify can now post a Slack message whenever a test is quarantined or dequarantined, so your team sees mitigation activity in real time. Test Insights ### Jun 11 ### [Set your merge queue checks timeout automatically](https://docs.mergify.com/changelog/2026-06-11-set-your-merge-queue-checks-timeout-automatically/) Merge queues can now compute their checks timeout from recent CI runtimes with \`checks\_timeout: auto\`, instead of requiring a fixed value. Merge Queue ### Jun 9 **Enterprise 8.16.0** released for self-hosted ### [Address cancelled checks separately with check-cancelled](https://docs.mergify.com/changelog/2026-06-09-address-cancelled-checks-separately-with-check-cancelled/) A new check-cancelled condition attribute matches checks with a cancelled conclusion independently from check-failure. Rules ### Jun 3 ### [Limit concurrent checks per scope](https://docs.mergify.com/changelog/2026-06-03-limit-concurrent-checks-per-scope/) Cap how many speculative checks run in parallel for each merge queue scope, so heavy areas of your monorepo can't starve the rest. Merge Queue ### Jun 2 ### [Auto-group queued pull requests by changed files](https://docs.mergify.com/changelog/2026-06-02-auto-group-queued-pull-requests-by-changed-files/) Mergify now batches queued pull requests that touch similar files together automatically, with no scopes, CI action, or API setup. Merge Queue ### [Auto-retry rules are now scoped per repository](https://docs.mergify.com/changelog/2026-06-02-auto-retry-rules-are-now-scoped-per-repository/) Auto-retry rules are now managed per repository instead of organization-wide, with a repository selector at the top of the page. CI Insights ### [Configure merge queue commit message format from the dashboard](https://docs.mergify.com/changelog/2026-06-02-configure-merge-queue-commit-message-format-from-the-dashboard/) A new modal editor lets you configure the declarative commit\_message\_format for queue rules directly from the dashboard. Merge Queue ### [Honor GitHub ruleset required reviewers](https://docs.mergify.com/changelog/2026-06-02-honor-github-ruleset-required-reviewers/) Mergify now waits for the team and user approvals required by GitHub rulesets before merging. Merge Protections ### [Isolated merge queue mode](https://docs.mergify.com/changelog/2026-06-02-isolated-merge-queue-mode/) A new \`isolated\` merge queue mode runs every batch as a fully independent car, so a failure or delay in one batch never blocks the others. Merge Queue ### [Mergify Stacks adoption in the dashboard](https://docs.mergify.com/changelog/2026-06-02-mergify-stacks-adoption-in-the-dashboard/) See how your team is using Mergify Stacks — install commands to share, plus a live adoption page with active stacks, repos using it, and trends over time. API ### [New activity log page](https://docs.mergify.com/changelog/2026-06-02-new-activity-log-page/) The Activity Log, a faster, filterable view of every Mergify event. Now replaces Event Logs on all repositories. Merge Queue ### [Scope `check-*` conditions to a specific GitHub App](https://docs.mergify.com/changelog/2026-06-02-scope-check-conditions-to-a-specific-github-app/) Bind a \`check-\*\` condition to the GitHub App that posted the check, so collisions from other installations cannot satisfy the rule. Rules ### May 8 **Enterprise 8.15.1** released for self-hosted ### May 6 ### [Automatic migration from `autoqueue` to `auto_merge_conditions`](https://docs.mergify.com/changelog/2026-05-06-automatic-migration-from-autoqueue-to-auto-merge-conditions/) Mergify now opens a migration PR that converts the deprecated \`queue\_rules\[\].autoqueue\` setting to the new \`merge\_protection\_settings.auto\_merge\_conditions\`. Merge Queue ### [`conditions` in queue rules is deprecated](https://docs.mergify.com/changelog/2026-05-06-conditions-in-queue-rules-is-deprecated/) The \`conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`merge\_conditions\` instead. DeprecationsMerge Queue ### [Declarative `commit_message_format` for merge commits](https://docs.mergify.com/changelog/2026-05-06-declarative-commit-message-format-for-merge-commits/) Configure merge commit titles, bodies, and trailers declaratively without writing Jinja2 templates. Merge QueueWorkflow Automation ### [Delegate Mergify admin powers to non-GitHub Owners](https://docs.mergify.com/changelog/2026-05-06-delegate-mergify-admin-powers-to-non-github-owners/) GitHub Owners can now delegate specific Mergify admin powers to individual users without granting them GitHub Owner rights. ### [Restrict auto-merge to specific pull requests with `auto_merge_conditions`](https://docs.mergify.com/changelog/2026-05-06-restrict-auto-merge-to-specific-pull-requests-with-auto-merge-conditions/) Configure which pull requests are eligible for auto-merge using a list of conditions instead of a global on/off toggle. Merge Protections ### [`routing_conditions` in queue rules is deprecated](https://docs.mergify.com/changelog/2026-05-06-routing-conditions-in-queue-rules-is-deprecated/) The \`routing\_conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`queue\_conditions\` instead. DeprecationsMerge Queue ### May 5 ### [Mergify Terraform provider](https://docs.mergify.com/changelog/2026-05-05-mergify-terraform-provider/) Manage Mergify product enablement declaratively with Terraform Integrations ### [`unqueue` command alias removed](https://docs.mergify.com/changelog/2026-05-05-unqueue-command-alias-removed/) The deprecated \`unqueue\` command alias has been removed; use \`dequeue\` instead. Workflow Automation ### Apr 28 **Enterprise 8.15.0** released for self-hosted ### Apr 22 ### [Buildkite support for CI Insights](https://docs.mergify.com/changelog/2026-04-22-buildkite-support-for-ci-insights/) Connect your Buildkite pipelines to Mergify CI Insights to track build and job performance alongside your GitHub Actions and Jenkins data. CI Insights ### Apr 21 ### [Auto-merge setting in Merge Protections](https://docs.mergify.com/changelog/2026-04-21-auto-merge-setting-in-merge-protections/) New auto\_merge setting that automatically merges or queues PRs when all merge protection conditions pass, replacing the deprecated autoqueue in queue rules. Merge ProtectionsDeprecations ### [Automated migration for check interruption default change](https://docs.mergify.com/changelog/2026-04-21-automated-migration-for-check-interruption-default-change/) An automated configuration migration adds explicit \`allow\_checks\_interruption: true\` to priority rules with priority higher than medium, preparing for the upcoming default change. Merge Queue ### [Check interruption disabled by default for priority rules](https://docs.mergify.com/changelog/2026-04-21-check-interruption-disabled-by-default-for-priority-rules/) The default for \`allow\_checks\_interruption\` in priority rules changes from true to false, so higher-priority pull requests no longer interrupt running checks unless explicitly configured. Merge Queue ### [Extended statistics date range to 3 months](https://docs.mergify.com/changelog/2026-04-21-extended-statistics-date-range-to-3-months/) You can now view merge queue statistics for up to 3 months instead of the previous 1-month limit. Merge Queue ### [Merge queue rebase with update\_bot\_account on fork pull requests](https://docs.mergify.com/changelog/2026-04-21-merge-queue-rebase-with-update-bot-account-on-fork-pull-requests/) Using the merge queue with \`update\_method=rebase\` and \`update\_bot\_account\` on fork pull requests is deprecated and will be removed on July 1, 2026. Deprecations ### [Pull request scopes API is now public](https://docs.mergify.com/changelog/2026-04-21-pull-request-scopes-api-is-now-public/) The endpoint to set scopes on pull requests is now available in the public API. API ### [Unified "Mergify Merge Queue" check run](https://docs.mergify.com/changelog/2026-04-21-unified-mergify-merge-queue-check-run/) A single "Mergify Merge Queue" check run on pull requests, providing a unified view of merge queue status. Merge Queue ### Apr 14 ### [Regex tester for auto-retry log patterns](https://docs.mergify.com/changelog/2026-04-14-regex-tester-for-auto-retry-log-patterns/) Test your regex patterns against sample log lines directly in the auto-retry rule builder. CI Insights ### Apr 13 ### [Parallel scopes](https://docs.mergify.com/changelog/2026-04-13-parallel-scopes/) Merge unrelated pull requests in parallel by grouping them into scopes based on the files they touch. Merge Queue ### Apr 9 ### [New `scope` attribute available for conditions](https://docs.mergify.com/changelog/2026-04-09-new-scope-attribute-available-for-conditions/) A new \`scope\` field is now exposed through pull requests attributes and can be used in conditions Merge ProtectionsMerge QueueWorkflow Automation ### Apr 7 ### [Native RSpec Integration for Test Insights](https://docs.mergify.com/changelog/2026-04-07-native-rspec-integration-for-test-insights/) RSpec projects can now use the rspec-mergify gem for automatic test result upload, flaky test detection, and flaky test prevention Test Insights ### [New merge-batch merge method for merge queue](https://docs.mergify.com/changelog/2026-04-07-new-merge-batch-merge-method-for-merge-queue/) A new merge-batch merge method merges the draft pull request prepared by the merge queue directly into the base branch Merge Queue ### [`rebase` action with `bot_account` on fork pull requests](https://docs.mergify.com/changelog/2026-04-07-rebase-action-with-bot-account-on-fork-pull-requests/) The \`rebase\` action with \`bot\_account\` impersonation on fork pull requests is deprecated and will be removed on July 1, 2026. Deprecations ### Apr 1 ### [Deprecation of queue\_branch\_merge\_method](https://docs.mergify.com/changelog/2026-04-01-deprecation-of-queue-branch-merge-method/) queue\_branch\_merge\_method is deprecated in favor of merge\_method: fast-forward, which now works in both inplace and draft-PR modes. DeprecationsMerge Queue ### Mar 30 ### [Deprecation of action delete\_head\_branch](https://docs.mergify.com/changelog/2026-03-30-deprecation-of-action-delete-head-branch/) The \`delete\_head\_branch\` action is deprecated. Deprecations ### [Match CI log patterns against check run annotations](https://docs.mergify.com/changelog/2026-03-30-match-ci-log-patterns-against-check-run-annotations/) Auto-retry log patterns now also match against GitHub check run annotations, not just log output. CI Insights ### Mar 26 **Enterprise 8.14.0** released for self-hosted ### Mar 23 ### [Log pattern matching for auto-retry rules](https://docs.mergify.com/changelog/2026-03-23-log-pattern-matching-for-auto-retry-rules/) Auto-Retry rules can now match against job log content to decide whether a failed job should be retried CI Insights ### Mar 20 ### [Merge Queue: PR exit reasons and idle time breakdown in stats](https://docs.mergify.com/changelog/2026-03-20-merge-queue-pr-exit-reasons-and-idle-time-breakdown-in-stats/) New stats endpoints for the merge queue dashboard: PR exit reasons count (unique PRs by final exit reason) and idle time breakdown (capacity, schedule, freeze). Powers the new Sankey flow diagram and stacked time chart. Merge Queue ### Mar 18 ### [Automatic CI retries in merge queue](https://docs.mergify.com/changelog/2026-03-18-automatic-ci-retries-in-merge-queue/) You can now configure Mergify to automatically retry failed CI checks before removing a pull request from the queue. Merge Queue ### [Deprecation of `post_check` action](https://docs.mergify.com/changelog/2026-03-18-deprecation-of-post-check-action/) Automatic migration of post\_check actions to merge\_protections entries DeprecationsMerge Protections ### Mar 17 ### [Time-binned merge queue checks outcome endpoint](https://docs.mergify.com/changelog/2026-03-17-time-binned-merge-queue-checks-outcome-endpoint/) New API endpoint to track dequeue reasons over time as a time-series graph Merge QueueAPI ### Mar 13 ### [Merge queue intake statistics endpoint](https://docs.mergify.com/changelog/2026-03-13-merge-queue-intake-statistics-endpoint/) New API endpoint to track pull requests entering the merge queue over time Merge QueueAPI ### Mar 12 ### [Batch bisection statistics API](https://docs.mergify.com/changelog/2026-03-12-batch-bisection-statistics-api/) New API endpoint to track merge queue bisection events, helping users optimize their batch size configuration. Merge QueueAPI ### [Test Insights: mitigation](https://docs.mergify.com/changelog/2026-03-12-test-insights-mitigation/) View quarantined tests on the default branch and turn auto-quarantine on so flaky tests don’t block merges. Test Insights ### Mar 11 ### [Merge Queue failure rate statistics](https://docs.mergify.com/changelog/2026-03-11-merge-queue-failure-rate-statistics/) A new failure\_rate endpoint is available in the merge queue statistics API, returning the ratio of failed to total PRs leaving the queue, broken down by time intervals. APIMerge Queue ### [Test Insights: prevention and detection](https://docs.mergify.com/changelog/2026-03-11-test-insights-prevention-and-detection/) Stop flaky tests from slowing you down. Prevention shows what gets caught before merge; Detection helps you find and fix the worst offenders. Test Insights ### Mar 10 **Enterprise 8.13.0** released for self-hosted ### Mar 4 ### [API support for GitHub PAT](https://docs.mergify.com/changelog/2026-03-04-api-support-for-github-pat/) It’s possible for users to use the API API ### Feb 18 ### [The requeue command is deprecated](https://docs.mergify.com/changelog/2026-02-18-the-requeue-command-is-deprecated/) The queue command can now requeue pull requests Merge QueueWorkflow AutomationDeprecations ### Jan 28 ### [New retry mode for failed jobs](https://docs.mergify.com/changelog/2026-01-28-new-retry-mode-for-failed-jobs/) CI Insights Auto Retry gets a new retry mode CI Insights ### Jan 27 ### [`autosquash` has been deprecated](https://docs.mergify.com/changelog/2026-01-27-autosquash-has-been-deprecated/) \`autosquash\` option will be removed soon Deprecations ### Jan 19 ### [Add ability for retry rules to retry entire pipelines](https://docs.mergify.com/changelog/2026-01-19-add-ability-for-retry-rules-to-retry-entire-pipelines/) Allow users to retry rules by choosing the retry mode CI Insights ### Jan 14 **Enterprise 8.12.0** released for self-hosted ### Jan 13 ### [Allow to configure schedule freeze exclusion conditions](https://docs.mergify.com/changelog/2026-01-13-allow-to-configure-schedule-freeze-exclusion-conditions/) Schedule Freeze exclusion conditions can now be configured Merge Protections ### [New Merge Queue status dashboard](https://docs.mergify.com/changelog/2026-01-13-new-merge-queue-status-dashboard/) The redesigned merge queue interface is now available to everyone Merge Queue ### Jan 7 ### [Add none option to status\_comments for merge queue](https://docs.mergify.com/changelog/2026-01-07-add-none-option-to-status-comments-for-merge-queue/) A new \`none\` value is now available for the \`status\_comments\` configuration option to completely disable merge queue status comments on pull requests. Merge Queue 2025 ---- ### Dec 24 ### [Allow to configure merge queue comment reporting](https://docs.mergify.com/changelog/2025-12-24-allow-to-configure-merge-queue-comment-reporting/) The status reported by the merge queue as comments can now be configured Merge Queue ### Dec 11 **Enterprise 8.11.0** released for self-hosted ### [Improved Merge Queue status reporting](https://docs.mergify.com/changelog/2025-12-11-improved-merge-queue-status-reporting/) Release of the Merge Queue status updates Merge Queue ### Nov 27 ### [Improved Merge Queue status reporting (beta)](https://docs.mergify.com/changelog/2025-11-27-improved-merge-queue-status-reporting-beta/) Improved Merge Queue status updates now give clearer, real-time insights into PR progress. Merge Queue ### Nov 20 ### [Bypass the injection of rulesets conditions in the Merge Queue](https://docs.mergify.com/changelog/2025-11-20-bypass-the-injection-of-rulesets-conditions-in-the-merge-queue/) Use the \`exempt\` bypass-actor mode for Mergify in your ruleset to skip injecting ruleset conditions into the Merge Queue. Merge ProtectionsMerge Queue ### Nov 14 ### [Adding merge queue commands to event log](https://docs.mergify.com/changelog/2025-11-14-adding-merge-queue-commands-to-event-log/) Commands for the merge queue are now recorded as part of the event log Merge Queue ### Nov 12 ### [Skip intermediate results](https://docs.mergify.com/changelog/2025-11-12-skip-intermediate-results/) Allows merging a PR early if a later batch including it passes all checks and conditions. Merge Queue ### Nov 7 ### [New changelog](https://docs.mergify.com/changelog/2025-11-07-new-changelog/) New unified changelog experience 🚀 ### Nov 6 ### [New statistics page visuals](https://docs.mergify.com/changelog/2025-11-06-new-statistics-page-visuals/) We upgraded the looks of the statistics page, including better charts and tooltips visuals. Merge Queue ### Oct 31 ### [New `glob` operator for conditions in the configuration](https://docs.mergify.com/changelog/2025-10-31-new-glob-operator-for-conditions-in-the-configuration/) Adds the \`\*=\` operator for glob-style pattern matching in conditions Rules ### Oct 29 ### [Unsuccessful checks are displayed on checks event](https://docs.mergify.com/changelog/2025-10-29-unsuccessful-checks-are-displayed-on-checks-event/) Better way to find unsuccessful checks Merge Queue ### Oct 27 ### [New Queue Resets & Batch Interruptions chart](https://docs.mergify.com/changelog/2025-10-27-new-queue-resets-batch-interruptions-chart/) New dedicated chart to track errors and problems in the merge queue, including failed checks, timeouts, queue resets, and batch failures. Merge Queue ### Oct 23 **Enterprise 8.10.1** released for self-hosted ### Oct 20 ### [Dequeued label on PR](https://docs.mergify.com/changelog/2025-10-20-dequeued-label-on-pr/) New label for identifying dequeued pull requests Merge Queue ### Sep 30 ### [`allow_inplace_checks` has been deprecated](https://docs.mergify.com/changelog/2025-09-30-allow-inplace-checks-has-been-deprecated/) \`allow\_inplace\_checks\` is deprecated — checks are now placed automatically based on \`batch\_size\`, \`merge\_conditions\`, and \`max\_parallel\_checks\`. DeprecationsMerge Queue ### Sep 24 ### [Add/remove `queued` label automatically on PRs](https://docs.mergify.com/changelog/2025-09-24-addremove-queued-label-automatically-on-prs/) New \`queued\_label\` option on \`merge\_queue\` automatically tags pull requests as they enter and leave the queue. Merge Queue ### Sep 16 ### [Custom column display in CI Insights](https://docs.mergify.com/changelog/2025-09-16-custom-column-display-in-ci-insights/) Toggle column visibility in CI Insights tables — preferences persist locally and travel with the URL when shared. CI Insights ### Sep 4 ### [Test failure details in PR comments](https://docs.mergify.com/changelog/2025-09-04-test-failure-details-in-pr-comments/) CI Insights PR comments now include test-level details: failed tests, flaky test history, and links to investigate further. CI Insights ### Sep 1 ### [Validate your configuration locally with a pre-commit hook](https://docs.mergify.com/changelog/2025-09-01-validate-your-configuration-locally-with-a-pre-commit-hook/) Mergify's official pre-commit hook validates your configuration locally before you push. Rules ### Aug 29 **Enterprise 8.9.1** released for self-hosted ### Aug 26 **Enterprise 8.9.0** released for self-hosted ### Aug 19 ### [Autoqueue option for queue rules](https://docs.mergify.com/changelog/2025-08-19-autoqueue-option-for-queue-rules/) New \`autoqueue\` field on \`queue\_rules\` automatically queues matching pull requests, removing the need for explicit \`queue\` actions. Merge Queue ### Jul 31 ### [CI Insights PR report](https://docs.mergify.com/changelog/2025-07-31-ci-insights-pr-report/) CI Insights now posts a summary comment on every pull request — failed jobs, flaky tests, execution time, and CI health at a glance. CI Insights ### Jul 28 ### [Partition rules are now deprecated](https://docs.mergify.com/changelog/2025-07-28-partition-rules-are-now-deprecated/) \`partition\_rules\` is deprecated — use \`queue\_rules\` instead. Existing configurations are being upgraded. Merge Queue ### Jul 18 ### [Allow to disable comment posting](https://docs.mergify.com/changelog/2025-07-18-allow-to-disable-comment-posting/) New configuration option enables or disables the comment posted by Merge Protections. Merge Protections ### Jun 30 ### [Remove deprecated implicit priority between queue rules](https://docs.mergify.com/changelog/2025-06-30-remove-deprecated-implicit-priority-between-queue-rules/) Implicit ordering by queue-rule definition is gone — use \`priority\_rules\` to control merge order. Merge Queue ### Jun 24 ### [Remove deprecated options of `queue` action](https://docs.mergify.com/changelog/2025-06-24-remove-deprecated-options-of-queue-action/) The deprecated options of the \`queue\` action have been removed. Merge QueueWorkflow Automation ### Jun 10 **Enterprise 8.8.0** released for self-hosted ### Jun 2 ### [`max_parallel_checks` is now 5 by default](https://docs.mergify.com/changelog/2025-06-02-max-parallel-checks-is-now-5-by-default/) \`max\_parallel\_checks\` now defaults to 5, reducing merge latency without overusing CI resources. Merge Queue ### May 26 ### [`GET /products/{owner}` endpoint has been removed](https://docs.mergify.com/changelog/2025-05-26-get-productsowner-endpoint-has-been-removed/) The \`GET /products/{owner}\` endpoint is replaced by \`GET /repos/{owner}\`, which returns more data. API ### May 9 **Enterprise 8.7.0** released for self-hosted ### Mar 31 ### [Add deployment success/failure to conditions](https://docs.mergify.com/changelog/2025-03-31-add-deployment-successfailure-to-conditions/) New \`deployment-success\` and \`deployment-failure\` conditions list a pull request's deployments and their outcome. Rules ### Mar 14 ### [Autosquash disabled by default for the `queue` action](https://docs.mergify.com/changelog/2025-03-14-autosquash-disabled-by-default-for-the-queue-action/) \`autosquash\` is now off by default for the \`queue\` action, so Mergify can rebase without impersonating the author. Workflow AutomationMerge Queue ### Mar 11 ### [Statistics by priority](https://docs.mergify.com/changelog/2025-03-11-statistics-by-priority/) Merge Queue statistics are now broken down by pull request priority. Merge Queue ### Mar 3 ### [Datadog scheduled freeze metrics](https://docs.mergify.com/changelog/2025-03-03-datadog-scheduled-freeze-metrics/) The Datadog integration now sends a metric for the number of ongoing scheduled freezes. Integrations ### Feb 25 ### [`disallow_checks_interruption_from_queues` has been deprecated](https://docs.mergify.com/changelog/2025-02-25-disallow-checks-interruption-from-queues-has-been-deprecated/) The \`disallow\_checks\_interruption\_from\_queues\` option has been removed — use \`priority\_rules\` instead. Merge Queue ### [Removal of queue freeze attributes](https://docs.mergify.com/changelog/2025-02-25-removal-of-queue-freeze-attributes/) The \`queue-freeze\` and \`queue-freeze-reason\` pull request attributes have been removed. Deprecations ### Feb 19 ### [Average batch size stats](https://docs.mergify.com/changelog/2025-02-19-average-batch-size-stats/) New API endpoint and dashboard chart expose average batch size statistics for your merge queue. APIMerge Queue ### Feb 18 ### [`priority_rules` from `queue_rules` removal](https://docs.mergify.com/changelog/2025-02-18-priority-rules-from-queue-rules-removal/) The deprecated \`priority\_rules\` section under \`queue\_rules\` has been removed — it's now top-level. Merge Queue ### Feb 14 ### [Deprecated `autoquash` option removal](https://docs.mergify.com/changelog/2025-02-14-deprecated-autoquash-option-removal/) The deprecated \`autosquash\` option has been removed from the \`queue\` action — set it under \`queue\_rules\` instead. Merge QueueRules ### [Remove deprecated `allow_checks_interruption`](https://docs.mergify.com/changelog/2025-02-14-remove-deprecated-allow-checks-interruption/) The deprecated \`allow\_checks\_interruption\` option has been removed. Merge Queue ### [Remove deprecated `allow_merging_configuration_change` option](https://docs.mergify.com/changelog/2025-02-14-remove-deprecated-allow-merging-configuration-change-option/) The deprecated \`allow\_merging\_configuration\_change\` option has been removed — it had been a no-op for the past year. Workflow Automation ### Feb 11 **Enterprise 8.6.0** released for self-hosted ### Jan 31 ### [Scheduled freezes support in Slack](https://docs.mergify.com/changelog/2025-01-31-scheduled-freezes-support-in-slack/) Send scheduled freeze creation, update, and deletion events from Merge Protections directly to a Slack channel. IntegrationsMerge Protections 2024 ---- ### Nov 21 ### [Merge Queue Freeze API is deprecated](https://docs.mergify.com/changelog/2024-11-21-merge-queue-freeze-api-is-deprecated/) The Freeze API is replaced by the Pause API, which adds \`allow\_checks\_to\_run\` to mimic the previous behavior. Merge Queue ### [New `updates` attribute available for conditions](https://docs.mergify.com/changelog/2024-11-21-new-updates-attribute-available-for-conditions/) New \`updates\` attribute exposes the list of updates pushed to a pull request's branch, usable in conditions. Rules ### Nov 14 ### [Slack integration](https://docs.mergify.com/changelog/2024-11-14-slack-integration/) Mergify integrates natively with Slack — send your merge queue activity to any channel. Integrations ### Nov 7 ### [Merge Protections reports pending events](https://docs.mergify.com/changelog/2024-11-07-merge-protections-reports-pending-events/) Merge protections with pending conditions (running CI, schedules) now report as pending instead of failing. Merge Protections ### Nov 4 ### [Datadog integration](https://docs.mergify.com/changelog/2024-11-04-datadog-integration/) New agent-less Datadog integration sends merge queue metrics straight from Mergify — enable it from your dashboard. Integrations ### Oct 29 **Enterprise 8.4.3** released for self-hosted ### Oct 21 **Enterprise 8.4.2** released for self-hosted **Enterprise 8.5.0** released for self-hosted ### Oct 15 **Enterprise 8.4.1** released for self-hosted ### Sep 23 ### [Add `max_parallel_checks`](https://docs.mergify.com/changelog/2024-09-23-add-max-parallel-checks/) New \`max\_parallel\_checks\` option for \`merge\_queue\` controls parallel checks and replaces the deprecated \`speculative\_checks\`. Merge Queue ### Sep 13 ### [Add allow\_checks\_interruption option in priority\_rules section](https://docs.mergify.com/changelog/2024-09-13-add-allow-checks-interruption-option-in-priority-rules-section/) Priority rules now support \`allow\_checks\_interruption\`, letting higher-priority PRs interrupt running checks. Merge Queue ### Sep 11 **Enterprise 8.4.0** released for self-hosted ### Sep 6 ### [Allow to have `queue_rule` in `defaults` section](https://docs.mergify.com/changelog/2024-09-06-allow-to-have-queue-rule-in-defaults-section/) Set defaults for queue rules — including \`bot\_account\` and \`batch\_size\` — via the \`defaults\` section, including across extended configurations. Merge Queue ### Aug 26 ### [Priority\_rules is now at the top level of the Mergify config](https://docs.mergify.com/changelog/2024-08-26-priority-rules-is-now-at-the-top-level-of-the-mergify-config/) \`priority\_rules\` is now a top-level option, with priorities applied globally across the merge queue. Merge Queue ### Jul 26 ### [Queue action options deprecation](https://docs.mergify.com/changelog/2024-07-26-queue-action-options-deprecation/) All \`queue\` action options are deprecated — configure them under \`queue\_rules\` instead. Workflow Automation ### May 28 ### [Allow to specify merge\_conflict\_style for copy and backport actions](https://docs.mergify.com/changelog/2024-05-28-allow-to-specify-merge-conflict-style-for-copy-and-backport-actions/) Set \`merge\_conflict\_style: diff3\` on \`copy\` and \`backport\` to use the diff3 style for conflict markers. Workflow Automation ### May 17 **Enterprise 8.3.0** released for self-hosted ### May 14 ### [Add merge-commit-sha attribute](https://docs.mergify.com/changelog/2024-05-14-add-merge-commit-sha-attribute/) New \`merge-commit-sha\` attribute exposes a pull request's merge commit SHA1 in rules and templates. Rules ### Apr 19 **Enterprise 8.2.0** released for self-hosted ### Mar 13 ### [Expose the number of added/deleted/modified lines](https://docs.mergify.com/changelog/2024-03-13-expose-the-number-of-addeddeletedmodified-lines/) New \`#added-lines\`, \`#deleted-lines\`, and \`#modified-lines\` attributes expose line-change counts in conditions and templates. Rules ### Mar 6 ### [Add merge queue total queue time](https://docs.mergify.com/changelog/2024-03-06-add-merge-queue-total-queue-time/) New API endpoint exposes the total queue time for pull requests, also surfaced in the dashboard statistics. APIMerge Queue ### Mar 1 ### [Add support for `description` key in `pull_request_rules`](https://docs.mergify.com/changelog/2024-03-01-add-support-for-description-key-in-pull-request-rules/) New \`description\` key documents what each pull request rule does. Rules ### Feb 29 ### [Add copy/backport action "report\_mode" option](https://docs.mergify.com/changelog/2024-02-29-add-copybackport-action-report-mode-option/) New \`report\_mode\` parameter lets you report \`copy\` and \`backport\` results as a GitHub check or as a comment. Workflow Automation ### Feb 27 ### [Copy/backport actions post comment with cherry-pick error](https://docs.mergify.com/changelog/2024-02-27-copybackport-actions-post-comment-with-cherry-pick-error/) When \`copy\` or \`backport\` fails to cherry-pick, Mergify now posts the error as a comment on the target pull request. Workflow Automation ### Feb 7 **Enterprise 8.1.0** released for self-hosted ### Jan 26 ### [`allow_merging_configuration_change` option is deprecated](https://docs.mergify.com/changelog/2024-01-26-allow-merging-configuration-change-option-is-deprecated/) Use \`-mergify-configuration-changed\` in your conditions instead — \`allow\_merging\_configuration\_change\` is deprecated. Workflow Automation ### Jan 24 ### [Add new endpoint for queue checks outcome](https://docs.mergify.com/changelog/2024-01-24-add-new-endpoint-for-queue-checks-outcome/) New API endpoint exposes statistics on queue checks outcome, replacing the previous endpoint. APIMerge Queue ### Jan 23 ### [Stats endpoints for the number of running checks](https://docs.mergify.com/changelog/2024-01-23-stats-endpoints-for-the-number-of-running-checks/) New statistics endpoint exposes the number of concurrent running checks. APIMerge Queue ### Jan 16 ### [Add mergify-configuration-changed condition](https://docs.mergify.com/changelog/2024-01-16-add-mergify-configuration-changed-condition/) New boolean condition \`mergify-configuration-changed\` is true when a pull request modifies the Mergify configuration. Rules ### Jan 4 ### [API endpoint for average/min/max queue size](https://docs.mergify.com/changelog/2024-01-04-api-endpoint-for-averageminmax-queue-size/) New API endpoint exposes the average, minimum, and maximum size of your merge queues over recent weeks. APIMerge Queue 2023 ---- ### Dec 22 ### [New API stats endpoint for average idle queue time](https://docs.mergify.com/changelog/2023-12-22-new-api-stats-endpoint-for-average-idle-queue-time/) APIMerge Queue ### Dec 21 ### [Add an endpoint with stats average runtime](https://docs.mergify.com/changelog/2023-12-21-add-an-endpoint-with-stats-average-runtime/) APIMerge Queue ### [Expose queue-frozen and queue-freeze-reason attribute](https://docs.mergify.com/changelog/2023-12-21-expose-queue-frozen-and-queue-freeze-reason-attribute/) Rules ### Dec 11 ### [New endpoint queues merged count by time intervals](https://docs.mergify.com/changelog/2023-12-11-new-endpoint-queues-merged-count-by-time-intervals/) APIMerge Queue ### Nov 30 **Enterprise 8.0.0** released for self-hosted ### Nov 22 ### [Drop `require_branch_protection` option](https://docs.mergify.com/changelog/2023-11-22-drop-require-branch-protection-option/) Merge Queue ### Nov 16 ### [Add `queue-name` attribute](https://docs.mergify.com/changelog/2023-11-16-add-queue-name-attribute/) Rules ### Nov 13 ### [Rename "unqueue" command to "dequeue"](https://docs.mergify.com/changelog/2023-11-13-rename-unqueue-command-to-dequeue/) Merge Queue ### Nov 2 ### [Add neutral\_conditions to post check action](https://docs.mergify.com/changelog/2023-11-02-add-neutral-conditions-to-post-check-action/) Workflow Automation ### Oct 31 ### [/events API deprecation](https://docs.mergify.com/changelog/2023-10-31-events-api-deprecation/) Deprecations ### Oct 26 **Enterprise 7.7.0** released for self-hosted ### [Add attribute `head-repo-full-name`](https://docs.mergify.com/changelog/2023-10-26-add-attribute-head-repo-full-name/) Rules ### Oct 20 ### [Autodetect best merge method](https://docs.mergify.com/changelog/2023-10-20-autodetect-best-merge-method/) Workflow Automation ### Sep 12 ### [New unqueue reason for branch update failure](https://docs.mergify.com/changelog/2023-09-12-new-unqueue-reason-for-branch-update-failure/) Merge Queue ### Sep 11 ### [Add unqueue reasons for conflicts](https://docs.mergify.com/changelog/2023-09-11-add-unqueue-reasons-for-conflicts/) Merge Queue ### Sep 6 ### [Add `branch_protection_injection_mode` to bypass branch protections](https://docs.mergify.com/changelog/2023-09-06-add-branch-protection-injection-mode-to-bypass-branch-protections/) Merge Queue ### Sep 1 ### [Add condition queue-dequeue-reason](https://docs.mergify.com/changelog/2023-09-01-add-condition-queue-dequeue-reason/) Merge QueueRules ### Aug 25 ### [New action: github\_actions](https://docs.mergify.com/changelog/2023-08-25-new-action-github-actions/) Workflow Automation ### Aug 22 ### [Automatically reembark pull request with requeue command](https://docs.mergify.com/changelog/2023-08-22-automatically-reembark-pull-request-with-requeue-command/) Merge Queue ### Aug 9 ### [Add added/modified/removed-files attributes](https://docs.mergify.com/changelog/2023-08-09-add-addedmodifiedremoved-files-attributes/) Rules ### Aug 4 ### [Support unspecified digits for current-datetime attribute](https://docs.mergify.com/changelog/2023-08-04-support-unspecified-digits-for-current-datetime-attribute/) Rules ### Jul 27 ### [Move `require_branch_protection` config option to `queue_rules`](https://docs.mergify.com/changelog/2023-07-27-move-require-branch-protection-config-option-to-queue-rules/) Merge Queue ### Jul 24 ### [Support timestamp intervals](https://docs.mergify.com/changelog/2023-07-24-support-timestamp-intervals/) Rules ### Jul 20 ### [Add `current-datetime` condition](https://docs.mergify.com/changelog/2023-07-20-add-current-datetime-condition/) Rules ### Jul 10 **Enterprise 7.6.0** released for self-hosted ### Jul 7 ### [Rename queue action `method` option in `merge_method`](https://docs.mergify.com/changelog/2023-07-07-rename-queue-action-method-option-in-merge-method/) Merge Queue ### Jul 6 ### [Add co-authors attribute](https://docs.mergify.com/changelog/2023-07-06-add-co-authors-attribute/) Rules ### Jul 4 **Enterprise 7.5.0** released for self-hosted ### Jun 27 ### [Merge Queue Pause](https://docs.mergify.com/changelog/2023-06-27-merge-queue-pause/) Merge Queue ### Jun 12 **Enterprise 7.4.0** released for self-hosted ### May 31 ### [New Actions read permission](https://docs.mergify.com/changelog/2023-05-31-new-actions-read-permission/) Integrations ### May 17 **Enterprise 6.0.1** released for self-hosted ### May 15 **Enterprise 7.3.0** released for self-hosted ### [Remove queue action 'priority' attribute](https://docs.mergify.com/changelog/2023-05-15-remove-queue-action-priority-attribute/) Merge Queue ### May 11 ### [Add new queue\_checks\_outcome endpoint that includes all partitions and queues](https://docs.mergify.com/changelog/2023-05-11-add-new-queue-checks-outcome-endpoint-that-includes-all-partitions-and-queues/) APIMerge Queue ### [Add time\_to\_merge endpoint that has data of all partitions and queues](https://docs.mergify.com/changelog/2023-05-11-add-time-to-merge-endpoint-that-has-data-of-all-partitions-and-queues/) APIMerge Queue ### Apr 19 ### [Support Merge-After condition in PR body](https://docs.mergify.com/changelog/2023-04-19-support-merge-after-condition-in-pr-body/) Workflow Automation ### Mar 31 ### [Allow to use autosquash with rebase update method](https://docs.mergify.com/changelog/2023-03-31-allow-to-use-autosquash-with-rebase-update-method/) Workflow Automation ### Mar 24 ### [Star attribute in commits list](https://docs.mergify.com/changelog/2023-03-24-star-attribute-in-commits-list/) Rules ### Mar 23 ### [Add partition\_rules](https://docs.mergify.com/changelog/2023-03-23-add-partition-rules/) Merge Queue ### Mar 15 ### [Drop rebase\_fallback option](https://docs.mergify.com/changelog/2023-03-15-drop-rebase-fallback-option/) Workflow AutomationMerge Queue ### [Open draft PR if no bot account is set and rebase is used](https://docs.mergify.com/changelog/2023-03-15-open-draft-pr-if-no-bot-account-is-set-and-rebase-is-used/) Merge Queue ### Feb 20 ### [Add routing\_conditions attribute to queue\_rules](https://docs.mergify.com/changelog/2023-02-20-add-routing-conditions-attribute-to-queue-rules/) Merge Queue ### [Allow to merge Mergify configuration automatically](https://docs.mergify.com/changelog/2023-02-20-allow-to-merge-mergify-configuration-automatically/) Workflow Automation ### Feb 3 ### [Priority option for queue is deprecated](https://docs.mergify.com/changelog/2023-02-03-priority-option-for-queue-is-deprecated/) Merge Queue ### Feb 2 **Enterprise 7.2.1** released for self-hosted ### Feb 1 ### [Rebasing pull requests with a random user is deprecated](https://docs.mergify.com/changelog/2023-02-01-rebasing-pull-requests-with-a-random-user-is-deprecated/) Deprecations ### Jan 31 **Enterprise 7.2.0** released for self-hosted ### Jan 18 ### [Add a merge\_conditions to queue\_rules to replace conditions](https://docs.mergify.com/changelog/2023-01-18-add-a-merge-conditions-to-queue-rules-to-replace-conditions/) Merge Queue ### [Allow labels value to have template variables](https://docs.mergify.com/changelog/2023-01-18-allow-labels-value-to-have-template-variables/) Rules ### Jan 9 **Enterprise 7.1.0** released for self-hosted ### [Add batch\_max\_failure\_resolution\_attempts](https://docs.mergify.com/changelog/2023-01-09-add-batch-max-failure-resolution-attempts/) Merge Queue ### Jan 6 ### [Add priority rules](https://docs.mergify.com/changelog/2023-01-06-add-priority-rules/) Merge Queue 2022 ---- ### Dec 15 ### [Conditions can access commit details](https://docs.mergify.com/changelog/2022-12-15-conditions-can-access-commit-details/) Rules ### [Option priority of merge action is deprecated](https://docs.mergify.com/changelog/2022-12-15-option-priority-of-merge-action-is-deprecated/) Deprecations ### Dec 13 ### [Default value for rebase\_fallback](https://docs.mergify.com/changelog/2022-12-13-default-value-for-rebase-fallback/) Deprecations ### Dec 7 ### [`rebase_fallback` is deprecated](https://docs.mergify.com/changelog/2022-12-07-rebase-fallback-is-deprecated/) Deprecations ### Dec 1 ### [Add freeze cascading effect disabling](https://docs.mergify.com/changelog/2022-12-01-add-freeze-cascading-effect-disabling/) Merge Queue ### Nov 22 ### [New statistics API](https://docs.mergify.com/changelog/2022-11-22-new-statistics-api/) APIMerge Queue ### Nov 16 ### [Rebase action autosquash when PR is up-to-date](https://docs.mergify.com/changelog/2022-11-16-rebase-action-autosquash-when-pr-is-up-to-date/) Workflow Automation ### Nov 15 ### [New toggle option for the `label` action](https://docs.mergify.com/changelog/2022-11-15-new-toggle-option-for-the-label-action/) Rules ### Nov 14 ### [Deprecation of current-\* conditions](https://docs.mergify.com/changelog/2022-11-14-deprecation-of-current-conditions/) RulesDeprecations ### Nov 9 **Enterprise 7.0.0** released for self-hosted ### Oct 26 ### [Improve branch protection compatibility](https://docs.mergify.com/changelog/2022-10-26-improve-branch-protection-compatibility/) Merge Queue ### Oct 20 **Enterprise 6.0.0** released for self-hosted ### Oct 14 ### [Queue statistics dashboard](https://docs.mergify.com/changelog/2022-10-14-queue-statistics-dashboard/) Merge Queue ### Oct 10 ### [Allow templating in conditions](https://docs.mergify.com/changelog/2022-10-10-allow-templating-in-conditions/) Rules ### Oct 6 ### [`branch-protection-review-decision` boolean conditions](https://docs.mergify.com/changelog/2022-10-06-branch-protection-review-decision-boolean-conditions/) Rules ### Sep 21 ### [Allow to extend configuration](https://docs.mergify.com/changelog/2022-09-21-allow-to-extend-configuration/) Rules ### Sep 9 ### [Queue branch merge method](https://docs.mergify.com/changelog/2022-09-09-queue-branch-merge-method/) Merge Queue ### Sep 7 ### [Event logs availability](https://docs.mergify.com/changelog/2022-09-07-event-logs-availability/) APIMerge QueueWorkflow Automation ### Sep 2 ### [Allow queue branch edition](https://docs.mergify.com/changelog/2022-09-02-allow-queue-branch-edition/) Merge Queue ### Aug 24 ### [Commands restrictions](https://docs.mergify.com/changelog/2022-08-24-commands-restrictions/) RulesWorkflow Automation ### Aug 1 ### [New dependabot attributes](https://docs.mergify.com/changelog/2022-08-01-new-dependabot-attributes/) Rules ### [New queue command](https://docs.mergify.com/changelog/2022-08-01-new-queue-command/) Workflow Automation ### Jul 20 ### [New shared configuration support](https://docs.mergify.com/changelog/2022-07-20-new-shared-configuration-support/) Rules ### [Queue branch prefix is now configurable](https://docs.mergify.com/changelog/2022-07-20-queue-branch-prefix-is-now-configurable/) Merge Queue ### Jun 20 **Enterprise 5.0.0** released for self-hosted ### May 13 ### [`allow_inplace_checks` changes](https://docs.mergify.com/changelog/2022-05-13-allow-inplace-checks-changes/) Merge Queue ### Apr 29 ### [`commits-behind` change](https://docs.mergify.com/changelog/2022-04-29-commits-behind-change/) Rules ### Apr 25 ### [`commit_message` removed](https://docs.mergify.com/changelog/2022-04-25-commit-message-removed/) Workflow AutomationDeprecations ### Apr 22 ### [API configuration validation endpoint](https://docs.mergify.com/changelog/2022-04-22-api-configuration-validation-endpoint/) DeprecationsAPI ### [`fast-forward` merge method](https://docs.mergify.com/changelog/2022-04-22-fast-forward-merge-method/) Workflow AutomationMerge Queue ### Apr 11 **Enterprise 4.1.1** released for self-hosted ### Mar 23 ### [`requeue` and `unqueue` commands](https://docs.mergify.com/changelog/2022-03-23-requeue-and-unqueue-commands/) Merge Queue ### Mar 16 ### [Queue freeze feature](https://docs.mergify.com/changelog/2022-03-16-queue-freeze-feature/) APIMerge Queue ### Mar 8 ### [New option disallow\_checks\_interruption\_from\_queue](https://docs.mergify.com/changelog/2022-03-08-new-option-disallow-checks-interruption-from-queue/) Merge Queue ### Feb 16 ### [`repository-name` and `repository-full-name`](https://docs.mergify.com/changelog/2022-02-16-repository-name-and-repository-full-name/) Rules ### Feb 7 ### [Add draft\_bot\_account](https://docs.mergify.com/changelog/2022-02-07-add-draft-bot-account/) Merge QueueWorkflow Automation ### Jan 12 ### [`strict` mode removed](https://docs.mergify.com/changelog/2022-01-12-strict-mode-removed/) Workflow AutomationDeprecations ### Jan 6 ### [`batch_max_wait_time` defaults to 30s](https://docs.mergify.com/changelog/2022-01-06-batch-max-wait-time-defaults-to-30s/) Workflow AutomationMerge Queue ### Jan 5 ### [New option batch\_max\_wait\_time](https://docs.mergify.com/changelog/2022-01-05-new-option-batch-max-wait-time/) Merge Queue No matching entries. Was this page helpful? Yes No Thanks for your feedback! --- # Unknown \--- title: API Usage description: Learn how to authenticate and work with the Mergify REST API. --- Mergify provides a RESTful API for integrating with your merge queues, CI Insights, and Workflow Automation. All API requests should be directed to: \`https://api.mergify.com/v1\` The API is entirely documented in the \[API Reference\](/api). ## Authentication The Mergify API supports three authentication methods, all using Bearer tokens: \*\*Application Keys\*\* (generated from your dashboard), \*\*GitHub Personal Access Tokens\*\*, and \*\*Mergify User Tokens\*\*. ### Creating an Application Key A key belongs to an organization, so start from the organization you want it to reach: 1. Open the \[dashboard\](https://dashboard.mergify.com) and select the organization. 2. Go to \*\*Settings → Developer → Application Keys\*\*. 3. Click \*\*Add Key\*\*, name the key, and pick its scope. 4. Click \*\*Create\*\*. ![Create application keys](https://docs.mergify.com/api/%7BapplicationKeysCreate%7D) The scope selector only appears if you are an admin of the GitHub organization. Everyone else creates \`ci\` keys, and creating, renaming, or deleting an \`admin\` key from an account that is not an org admin fails with \`403\`. The key appears once, in a banner above the list. Copy it before you leave the page: reloading does not bring it back, and there is no way to recover it. If you lose one, delete the key and create another. ![Application key token](https://docs.mergify.com/api/%7BapplicationKeysToken%7D) ### Application Key Scopes Application keys have two scopes, picked when you create the key: - \`admin\`: the whole API, except uploading results, setting \[Merge Queue Scopes\](/merge-queue/scopes), and the mid-run flaky-detection and test-selection reads below, which need a \`ci\` key. - \`ci\`: uploading CI and test results, setting Merge Queue Scopes, and the reads a job makes while it runs: the list of \[quarantined\](/test-insights/quarantine) tests, and the \[flaky-detection\](/ci-insights/flaky-test-detection) and test-selection data the test framework integrations fetch mid-run. A \`ci\` key reaches nothing else in Test Insights. Browsing tests, their executions and their failures, and adding or removing a quarantine, are answered with \`403\` and need an \`admin\` key, a GitHub personal access token, or a user token. A \`ci\` key sits in CI configuration, where a build log or a workflow file can reach it, so it carries only what an unattended job needs. A key belongs to a GitHub account, not to a repository or to the person who created it. It works on every repository of that account and carries no GitHub repository role, so the \[Features Permissions\](/security#features-permissions) table does not restrict it. ### Using the API Key With the provided API key, you're set to make authenticated requests against the Mergify API. For example, to validate the authenticity of your token, you can retrieve your application's information: \`\`\`bash curl -H "Accept: application/json" \\ -H "Authorization: Bearer " \\ https://api.mergify.com/v1/application \`\`\` Response: \`\`\`json { "id": "e155518c-ca1b-443c-9be9-fe90fdab7345", "name": "my application", "scope": "ci", "account\_scope": { "id": 123456, "login": "Mergifyio" } } \`\`\` The \`scope\` field tells you which of the two scopes above the key holds. ### Using a GitHub Personal Access Token As an alternative to application keys, you can authenticate to the Mergify API using a \*\*GitHub Personal Access Token (PAT)\*\* as a Bearer token. This is useful when integrating with tools that already have a GitHub token available, such as CI environments. You must have logged in to the \[Mergify dashboard\](https://dashboard.mergify.com) at least once using GitHub OAuth before using this method. The PAT is only used to verify your GitHub identity: all permissions are based on your Mergify account, not the PAT's scopes. \*\*Accepted token formats:\*\* - \`ghp\_\*\`: \[classic personal access tokens\](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) - \`github\_pat\_\*\`: \[fine-grained personal access tokens\](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) - \`gho\_\*\`: GitHub OAuth user tokens Tokens issued to a GitHub App rather than to a user (\`ghu\_\*\`, \`ghs\_\*\`) are not accepted. A job that only has an app installation token needs an application key instead. Example: \`\`\`bash curl -H "Accept: application/json" \\ -H "Authorization: Bearer " \\ https://api.mergify.com/v1/repos///queues \`\`\` :::note The PAT is used solely for identity verification. The token's GitHub scopes do not affect what you can access in the Mergify API; permissions are determined by your Mergify user account and its associated organizations. ::: ### Using a Mergify User Token Mergify also issues user tokens of its own, recognizable by their \`mut\_\` prefix and obtained through the OAuth 2.0 device authorization grant. Run \[\`mergify auth login\`\](/cli/usage#authentication) to get one. Send it as a Bearer token, the same way as the credentials above. A user token identifies the person it was issued to. It reaches exactly what its owner's dashboard session reaches, and nothing on GitHub directly, so holding one grants no access its owner does not already have. :::caution Four endpoints refuse a PAT and a user token alike, and need an application key. \`GET /application\` describes the key it was called with, so it accepts either scope. The \`PUT\` on \`/repos/{owner}/{repository}/commits/{sha}/scopes\` and the \`PUT\` and \`POST\` on \`/repos/{owner}/{repository}/pulls/{number}/scopes\` need a \`ci\` key. Everything else takes a PAT, a user token, or an \`admin\` key; each endpoint in the \[API Reference\](/api) lists the credentials it accepts. ::: ### Revoking an Application Key If, for any reason, you need to revoke an application key: 1. Open \*\*Settings → Developer → Application Keys\*\* in the \[dashboard\](https://dashboard.mergify.com). 2. Click the delete icon on the key's row, and confirm. ![Delete application key](https://docs.mergify.com/api/%7BapplicationKeysDelete%7D) The key is removed, revoking any access it provided. ## Pagination Endpoints that return lists of items use cursor-based pagination. Paginated responses include a \`Link\` header (\[RFC 5988\](https://www.rfc-editor.org/rfc/rfc5988)) with URLs for navigating between pages. \*\*Query parameters:\*\* - \`per\_page\`: Number of items per page, from 1 to 100. Most paginated endpoints default to 10. On others, pagination is opt-in: they have no default and return the whole list in a single response until you pass \`per\_page\`. Where pagination is opt-in, the endpoint's entry in the \[API Reference\](/api) says so. - \`cursor\`: Opaque cursor for the current page. Extract this from the \`Link\` header; do not construct it manually. \*\*Link header example:\*\* \`\`\`http Link: //logs?cursor=abc&per\_page=20>; rel="next", //logs?cursor=def&per\_page=20>; rel="prev" \`\`\` The \`Link\` header may include the following relations: - \`next\`: The next page of results - \`prev\`: The previous page of results Each relation appears only when that page exists: \`next\` is absent on the last page, \`prev\` on the first. The two are independent, and a middle page carries both. When neither applies — a result set that fits on a single page — the \`Link\` header is omitted entirely. To iterate through all pages, follow the \`rel="next"\` link until it is no longer present in the response. To get back to the first page, call the endpoint again without a \`cursor\`. Each link carries the query parameters of the request it came from, so following one keeps the filters you set. On an endpoint whose \`start\` and \`end\` default to a window ending at the current time, the resolved bounds are pinned into the links too: iterating with \`rel="next"\` keeps serving the window the first page was built from, instead of resolving a fresh one against a later clock and dropping the oldest items on the way. A bound you passed yourself is echoed back as you sent it. ## Error Handling The API uses standard HTTP status codes to indicate the success or failure of a request. | Status Code | Meaning | Description | |-------------|---------|-------------| | \`200\` | OK | The request succeeded. | | \`201\` | Created | The resource was created. | | \`204\` | No Content | The request succeeded and the response has no body. | | \`403\` | Forbidden | The credential was refused, or is valid but lacks permission for this resource. | | \`404\` | Not Found | The requested resource does not exist. | | \`409\` | Conflict | The request conflicts with the current state of the resource. | | \`422\` | Unprocessable Entity | The request body or parameters are invalid. | --- # Unknown \--- title: Rule Syntax description: How to write a Mergify workflow rule, from the structure of pull\_request\_rules to its conditions and actions. --- Workflow Automation rules live under the \`pull\_request\_rules\` key in your \[configuration file\](/configuration/file-format), where each rule pairs a set of conditions with the actions Mergify runs when a pull request matches them. For a gentle introduction, see the \[Workflow Automation overview\](/workflow). This page is the field-by-field reference. ## Fields \`pull\_request\_rules\` is a list, and each entry is a single rule: a YAML dictionary where \`name\`, \`conditions\`, and \`actions\` are required, while \`description\` and \`disabled\` are optional. | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`actions\` | Actions | | The actions to perform when the rule matches. | | \`conditions\` | List of conditions | | The conditions that must be met for the rule to be evaluated. | | \`description\` | string or null | \`null\` | A description of the rule. | | \`disabled\` | DisabledDict or null | \`null\` | If the rule is disabled, the reason why it's disabled. | | \`name\` | string | | The name of the rule. This is used when reporting information about a rule. It's not possible to have two rules with the same name. | ## Conditions \`conditions\` is a list of expressions describing which pull requests the rule applies to. A pull request must satisfy \*\*every\*\* condition in the list for the rule to match: \`\`\`yaml conditions: - base = main - label = ready-to-merge \`\`\` Each condition is built from an attribute (such as \`base\`, \`label\`, or \`#approved-reviews-by\`), an operator (such as \`=\`, \`>=\`, or \`~=\`), and usually a value. See the \[attributes list\](/configuration/conditions#attributes-list) and \[operators list\](/configuration/conditions#operators-list) for the full set. To express "any of" or "none of" instead of "all of", group conditions with the \[\`and\`, \`or\`, and \`not\` operators\](/configuration/conditions#combining-conditions-using-logical-operators). The same condition syntax also powers \[Merge Queue\](/merge-queue) and \[Merge Protections\](/merge-protections), so what you learn here carries over. ## Actions \`actions\` is a dictionary that maps an action name to its parameters. A single rule can run several actions, and Mergify runs them all when the conditions match: \`\`\`yaml pull\_request\_rules: - name: warn and label pull requests in conflict conditions: - conflict actions: comment: message: "@{{ author }} this pull request is now in conflict 😩" label: toggle: - conflict \`\`\` The \`{{ author }}\` placeholder uses \[variable substitution\](/configuration/data-types#variable-substitution): Mergify fills it in with the pull request's data. Browse every available action and its parameters in the \[Actions catalog\](/workflow/actions). ## Combining Rules Mergify checks every rule against the pull request, and matching does not stop at the first hit: each rule whose conditions match runs its actions. Rule order still decides one thing. \`close\`, \`delete\_head\_branch\`, \`merge\`, \`queue\`, \`rebase\`, \`squash\` and \`update\` refuse to run twice in the same evaluation. When two matching rules both carry one of them, the rule listed first in the file runs it, and the later rule's check reports that another action of that kind already ran. Put the rule you want to win above the others. For when an action re-runs versus stays put, see \[how rules are evaluated\](/workflow#how-rules-are-evaluated). ## Disabling a Rule Set \`disabled\` with a \`reason\` to keep a rule in the file but stop it from running. Mergify strikes the rule through in the \*\*Summary\*\* check run and prints the reason under it, so others know why: \`\`\`yaml pull\_request\_rules: - name: automatic merge disabled: reason: paused during the release freeze conditions: - "#approved-reviews-by >= 1" actions: merge: # merge with default options \`\`\` ## Validating Your Rules Mergify validates your configuration on every push and reports problems in the "Checks" tab of your pull request. To catch mistakes earlier, validate and simulate rules locally with the \[Mergify CLI\](/cli/config): \`\`\`bash mergify config validate mergify config simulate https://github.com/owner/repo/pull/142 \`\`\` See \[Validation and Troubleshooting\](/configuration/file-format#validation-and-troubleshooting) for the full workflow. --- # Unknown \--- title: "\`batch\_max\_wait\_time\` defaults to 30s" date: 2022-01-06 tags: - Workflow Automation - Merge Queue description: "" --- Change the default value for \`batch\_max\_wait\_time\` to \`30s\`. --- # Unknown \--- title: "\`strict\` mode removed" date: 2022-01-12 tags: - Workflow Automation - Deprecations description: "" --- Remove deprecated \`strict\` mode on the \`merge\` action. --- # Unknown \--- title: 'Browser Extensions' description: 'Install the Chrome or Firefox extension to surface Mergify Merge Queue and stack controls, plus read report timestamps in your own timezone, directly inside GitHub pull requests.' --- ## Why Use the Browser Extensions? The Chrome and Firefox extensions inject a small Mergify panel into every GitHub pull request you open. The panel surfaces the most common actions without typing \[commands\](/commands) and shows Mergify context (queue state, stack position) directly in the pull request. Use them when you want to: - Enqueue a pull request as soon as you review it. - Quickly dequeue without context switching. - See at a glance whether the pull request is already in one of your queues. - See a \[stack's\](/stacks) chain and revision history without opening the CLI. - Read the timestamps in Merge Queue reports in your own timezone instead of UTC. ## Locate the Official Download Links The dashboard keeps the canonical links to the Chrome Web Store and Firefox Add-ons listing so you always grab the signed builds. 1. Sign in to the \[Mergify dashboard\](https://dashboard.mergify.com). 2. Open \*\*Settings → Integrations\*\* and pick the \*\*Browser\*\* category. 3. On the \*\*Chrome Extension\*\* or \*\*Firefox Add-On\*\* card, click \*\*Install\*\*. The button reads \*\*Installed\*\* when the browser you are using already has it. \*\*Merge Queue → Deployment → Browser Extension\*\* carries the same two links, labeled \*\*Add to Chrome\*\* and \*\*Add to Firefox\*\*, next to a summary of what the panel adds to a pull request. ![The Browser category of the Mergify Integrations page, with the Chrome Extension and Firefox Add-On cards](https://docs.mergify.com/%7BextensionListScreen%7D) ## Install on Chrome or Firefox ### Chrome 1. Click \*\*Install\*\* on the Chrome Extension card, or \*\*Add to Chrome\*\* on the Deployment page. 2. Confirm the permissions in the Chrome Web Store dialog. ### Firefox 1. Click \*\*Install\*\* on the Firefox Add-On card, or \*\*Add to Firefox\*\* on the Deployment page. 2. Approve the requested permissions in the Firefox Add-ons prompt. ## Merge Queue Controls After installation, reload any pull request on GitHub. A Mergify panel appears above the GitHub merge box, with a button for each command you would otherwise leave as a comment: - \*\*Queue\*\* and \*\*Requeue\*\* both run \[\`queue\`\](/commands/queue) to put the pull request into the merge queue. - \*\*Dequeue\*\* runs \[\`dequeue\`\](/commands/dequeue) to take it back out. - \*\*Refresh\*\* runs \[\`refresh\`\](/commands/refresh) to re-evaluate the pull request against your configuration. - \*\*Rebase branch\*\* and \*\*Update branch\*\* run \[\`rebase\`\](/commands/rebase) and \[\`update\`\](/commands/update) to bring the pull request up to date with its base branch. Two links next to the buttons open the pull request's Mergify event history and the merge queue it sits in. ![Mergify browser extension panel injected into a GitHub pull request](https://docs.mergify.com/%7BextensionPrScreen%7D) ## Timestamps in Your Timezone The extension rewrites the UTC timestamps in Mergify's Merge Queue reports into your browser's timezone, so the times already match your local clock. The Mergify engine writes those timestamps in UTC so a report reads the same way for everyone, wherever they are. Without the extension, you have to convert each timestamp in your head to tell whether a pull request entered the queue during your workday, or when it is expected to merge. There is nothing to set up: the extension follows your browser, so the times stay correct when you travel or switch machines. Hovering a converted timestamp reveals the original UTC value, so the source time is never lost when you compare notes with a teammate in another timezone. The extension only rewrites Mergify's own comments and leaves the rest of the pull request as GitHub renders it. ## Stacks Panel For repositories using \[Stacks\](/stacks), the extension renders the Mergify Stacks panel inside the pull request. It shows the full chain of stacked PRs, highlights where the current PR sits, and includes the \[revision-history\](/stacks/reviewing#revision-history) timeline so you can see how each commit evolved across pushes without leaving GitHub. ![Mergify Stacks panel with the stack and its revision history timeline on a pull request](https://docs.mergify.com/%7BstacksPanel%7D) --- # Unknown \--- title: Mergify Billing System description: Understand how Mergify fair billing works. --- This page explains how Mergify's contributor-based billing works and how to read your invoice. ## Contributor-Based Billing Many enterprise solutions charge per user, irrespective of actual usage. At Mergify, we firmly believe in billing you only for what you actively use. This is why our billing system operates on the principle of contributors. Here's how it works: - A contributor is any user who \*\*contributes commits to a pull request\*\*, either by opening it or by pushing new commits to it. Other activity, such as reviewing, commenting on, closing, or reopening a pull request, does not make someone a contributor. - Bot accounts are never contributors. A GitHub App or bot user that opens a pull request or pushes to one, such as a dependency updater, is skipped. So are \`web-flow\`, the account GitHub attributes web-editor commits to, and accounts that have since been deleted. Only real user accounts are counted. - Each user is counted \*\*only once\*\*, even if they contribute to pull requests across multiple repositories. - The system uses a 30-day sliding window. A user is counted as a contributor for 30 days after they open a pull request or push commits to one. After that period, if they make no further contributions, they are no longer considered active for billing purposes. - Usage is prorated to the day: if a contributor is seen active during 48 days, the system only bills for precisely 48 days, not 2 entire months. ### Estimating Contributors If you don't know the number of contributors that Mergify might count, you can use this script to estimate the number of contributors over the last 30 days. 1. Go to \[https://github.com/settings/tokens\](https://github.com/settings/tokens) (or the equivalent page on your GitHub Enterprise Server installation, at \`https:///settings/tokens\`) to create a token. The token must have the permissions to access the repository (read permission is enough); 2. Export the token as an environment variable with \`export GITHUB\_TOKEN=\`; 3. Install \[\`requests\`\](https://pypi.python.org/pypi/requests) on your system by running \`python3 -m pip install requests\`; 4. Run the script with \`python3 mergify-count-contributors.py etc\`, passing the list of repositories where Mergify will be deployed. Use the full repository URLs, including the host, so the script can reach the right API endpoint (for example \`https://github.com/org/repo\` for GitHub.com or \`https://github.example.com/org/repo\` for GitHub Enterprise Server). The script will run and print its progress. It can take several minutes for the script to complete depending on the number of repositories scanned and the number of active pull requests they have. :::note The script automatically targets the GitHub Enterprise Server REST API (\`https:///api/v3\`) based on the repository URLs you pass. If your installation serves a self-signed or internal-CA certificate, you can disable TLS verification by setting \`export GITHUB\_SKIP\_SSL\_VERIFY=1\` before running the script. ::: :::caution This script provides an \*\*approximate estimate\*\* of the number of users that Mergify might consider active. It does not fully replicate the internal logic used by Mergify to count active users, so discrepancies may exist. This script is for reference only and should not be considered the source of truth. ::: ## Annual Subscription Mergify does not require an annual subscription (except for the Enterprise plan), but offers a large discount if you buy users in advance for a 12-month period. An annual subscription allows you to buy a base number of seats (users) per product at the start of the year. If your usage goes beyond the pre-purchased seats, additional seats are billed monthly, prorated to the exact day of use. For example, let's say you have purchased an annual license for 100 users. If your number of users increases to 110 users during 45 days, you will be invoiced for 10 extra users over 45 days. :::note You can subscribe to a yearly plan at any time by contacting [your customer representative](mailto:support@mergify.com) . ::: ## Checking Current Usage You can check your current usage on the \[Plan page\](https://dashboard.mergify.com/settings/plan) of the Mergify dashboard, under \*\*Settings → Plan\*\*. It lists each product you use in a table, with its repository count and its number of active contributors: | Product | Repositories | Active contributors | |---|---|---| | Merge Queue | 10 repositories | 25 contributors | | CI Insights | 5 repositories | 15 contributors | | Workflow Automation | 10 repositories | 25 contributors | The counts above are examples. If you are a billing manager, the table has an \*\*On-demand Usage\*\* column showing what you are billed monthly on top of your plan. On a yearly subscription, it also has a \*\*Committed\*\* column showing the seats you pre-purchased. On some plans the third column is headed \*\*Collaborators\*\* instead. It counts everyone with access to a repository, rather than only the people who contributed to it. Both counts are clickable: the repository count takes you to your repositories list, and the contributor count opens the list of people counted for that product. :::note This is not available for on-premise plans. ::: ## Switching or Cancelling Plans If you wish to switch between plans or cancel your subscription, [please contact our customer support](mailto:support@mergify.com) . They'll guide you through the process and ensure a smooth transition. When you cancel, your subscription stays active until the end of the billing period you already paid for, and it does not renew. You may still receive one last invoice on that final day (see \[Final Invoice After Cancellation\](#3-final-invoice-after-cancellation) below). ## Understanding Your Invoice A single invoice usually mixes two things: an adjustment for the period that just ended, and the charge for the period that is starting. The adjustment is there because the number of contributors Mergify counts can change any day. Cancelling your subscription produces one more invoice, which works differently and is covered last. ### 1. \*\*Real-time User Adjustment\*\* Mergify keeps the number of seats on your subscription in step with the number of contributors it counts. Every time that count changes, the adjustment is prorated: you are credited for the seats you had already paid for over the rest of the period, then charged for the new count over those same days. Both lines show up on your next invoice, labeled "unused time" and "remaining time" by our payment provider, so only the difference between them changes your total. ### 2. \*\*Upcoming Period Charge\*\* The rest of the invoice charges the period that is about to start, based on your user count on the day it is issued. If that count changes during the period, the next invoice carries the same kind of adjustment. ### A Worked Example Say \`example-org\` is billed on the 1st of each month at $10 per user per month and has 20 contributors. Two more contributors push commits on April 16th, halfway through the period. The invoice issued on May 1st then reads: | Line | Period | Amount | |---|---|---| | Unused time on 20 users | Apr 16 – May 1 | -$100.00 | | Remaining time on 22 users | Apr 16 – May 1 | $110.00 | | 22 users | May 1 – Jun 1 | $220.00 | | \*\*Total\*\* | | \*\*$230.00\*\* | The first two lines are the real-time user adjustment: half of April is credited back at the old count, and the same half is re-charged at the new one. The $10 difference is what the two extra contributors cost for the time they were counted. The third line is the upcoming period, at the count you have on the day the invoice is issued. :::note \`example-org\`, the 20 contributors, and the $10 per-user rate are all made up to keep the arithmetic easy to follow. Your own invoice uses the rate on your plan, and your billing dates come from your own subscription. ::: ### 3. \*\*Final Invoice After Cancellation\*\* When you cancel your subscription, it stays active until the end of the billing period you already paid for, then ends without renewing. You may still receive one last invoice dated on that final day. That last invoice covers your final billing period, not a renewal. It collects the \[real-time user adjustments\](#1-real-time-user-adjustment) described above: when your user count changes mid-period, the prorated difference is only settled on the next invoice, which for a cancelled subscription is the final one, issued when the period ends. So if your team grew during your last month, that growth is billed on the day your subscription ends. Once you pay it, you won't be charged again. By understanding how your invoices are built, you can more easily interpret and anticipate how changes in your contributors influence your Mergify charges. --- # Unknown #!/usr/bin/env python3 # This script counts the number of contributors for repositories over the last 30 days. # # A contributor is a user who contributed commits to a pull request in the last # 30 days, either by opening it or by pushing commits to it. This matches how # Mergify counts active users for billing. # # It works with both GitHub.com and GitHub Enterprise Server (GHES): the API # endpoint is derived automatically from each repository URL you pass. # # See https://docs.mergify.com/billing/ for context. # # Keep in mind that this is not 100% accurate but gives a ballpark estimate. # # You'll need Python 3 and requests for this to work. # You can install requests by running: # $ pip install requests # then run this script with: # $ python3 mergify-count-contributors.py \# # Environment variables: # - GITHUB\_TOKEN: a token that can read the repositories (required). # - GITHUB\_SKIP\_SSL\_VERIFY: set to "1" to disable TLS certificate verification. # Useful for GHES installations that serve a self-signed or internal-CA # certificate. Disabling verification is insecure; prefer trusting the CA. import collections import os from datetime import datetime, timedelta, timezone from urllib.parse import urlparse import requests from urllib3.exceptions import InsecureRequestWarning LOOKBACK\_WINDOW = timedelta(days=30) # GitHub timestamps are in UTC, so compare against an explicit UTC "now". SINCE\_DATE = datetime.now(timezone.utc) - LOOKBACK\_WINDOW HEADERS = { "Authorization": f"token {os.environ.get('GITHUB\_TOKEN')}", "Accept": "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28", } # GHES installations commonly use a self-signed or internal-CA certificate. Let # users opt out of TLS verification when they cannot install the CA locally. VERIFY\_SSL = os.environ.get("GITHUB\_SKIP\_SSL\_VERIFY", "").lower() not in ( "1", "true", "yes", ) if not VERIFY\_SSL: # Only silence the "insecure request" warning, so other warnings still surface. requests.packages.urllib3.disable\_warnings(InsecureRequestWarning) # type: ignore\[attr-defined\] def get\_api\_and\_repo\_name\_from\_url(url): """Derive the REST API endpoint and "owner/repo" name from a repository URL. Supports github.com, GitHub Enterprise Cloud with data residency (\`\`\*.ghe.com\`\`), and GitHub Enterprise Server (any other host, served under \`\`/api/v3\`\`). """ parsed = urlparse(url) host = parsed.netloc.lower() scheme = parsed.scheme or "https" if host in ("github.com", "www.github.com"): api\_endpoint = "https://api.github.com" elif host.endswith(".ghe.com"): # GitHub Enterprise Cloud with data residency. api\_endpoint = f"{scheme}://api.{host}" else: # GitHub Enterprise Server: the REST API lives under /api/v3. api\_endpoint = f"{scheme}://{parsed.netloc}/api/v3" return api\_endpoint, parsed.path.strip("/") def \_requests\_get(\*args, \*\*kwargs): kwargs.setdefault("headers", HEADERS) kwargs.setdefault("verify", VERIFY\_SSL) try: response = requests.get(\*args, \*\*kwargs) response.raise\_for\_status() except requests.exceptions.HTTPError as e: print(f"E: Unable to request GitHub: {e}") raise else: return response def \_iter\_pages(url, params=None): """Yield items page by page, incrementing \`\`page\`\` until a short page is returned.""" params = dict(params or {}) params.setdefault("per\_page", 100) page = 1 while True: params\["page"\] = page response = \_requests\_get(url, params=params) items = response.json() yield from items # Stop once a short page is returned: there is nothing left to fetch. if len(items) < params\["per\_page"\]: return page += 1 def get\_active\_prs\_for\_repo(api\_endpoint, repo\_name): prs = \[\] try: pulls = \_iter\_pages( f"{api\_endpoint}/repos/{repo\_name}/pulls", params={"state": "all", "sort": "created", "direction": "desc"}, ) for pr in pulls: created\_at = datetime.fromisoformat( pr\["created\_at"\].replace("Z", "+00:00") ) if created\_at >= SINCE\_DATE: prs.append(pr) else: # PRs are sorted newest first: once we cross the window, stop. break except Exception as e: print(f"W: Unable to retrieve PR list, ignoring: {e}") return prs def is\_user\_ignored(user): """Determine if a user should be ignored (bots, system users).""" return ( user\["id"\] <= 0 or user\["login"\].endswith("\[bot\]") or user\["type"\] == "Bot" or user\["login"\] == "web-flow" ) def get\_users\_from\_pr(api\_endpoint, repo\_name, pr): """Extract the billable users from a PR: its author and the users who pushed commits to it.""" users = set() # The PR author (counted when the pull request is opened). user = pr\["user"\] if not is\_user\_ignored(user): users.add(user\["login"\]) # The users who pushed commits to the PR. Mergify bills the pusher on each # push; the commit author and committer are the closest proxy available # from the API. try: commits = \_iter\_pages( f"{api\_endpoint}/repos/{repo\_name}/pulls/{pr\['number'\]}/commits" ) for commit in commits: for actor in (commit.get("author"), commit.get("committer")): if actor and not is\_user\_ignored(actor): users.add(actor\["login"\]) except Exception as e: print(f"W: Unable to retrieve PR commits, ignoring: {e}") return users def main(repos): """Main function to fetch active users per repository.""" active\_users\_per\_repo = collections.defaultdict(set) for api\_endpoint, repo in (get\_api\_and\_repo\_name\_from\_url(url) for url in repos): print(f"Getting active PRs for {repo}") active\_prs = get\_active\_prs\_for\_repo(api\_endpoint, repo) nb\_active\_prs = len(active\_prs) print(f" -> Found {nb\_active\_prs} PRs since {SINCE\_DATE}") for i, pr in enumerate(active\_prs): print( f" -> Retrieving contributors for #{pr\['number'\]} {i + 1}/{nb\_active\_prs}" ) active\_users\_per\_repo\[repo\] |= get\_users\_from\_pr(api\_endpoint, repo, pr) print(f"Active users since {SINCE\_DATE}:") for repo, users in active\_users\_per\_repo.items(): print(f" {repo}: {sorted(users)}") unique\_users = set() for users in active\_users\_per\_repo.values(): unique\_users |= users print("\*\*\* Unique users:") print(f" {sorted(unique\_users)}") print(f"\*\*\* Total unique users: {len(unique\_users)}") if \_\_name\_\_ == "\_\_main\_\_": import sys if not os.environ.get("GITHUB\_TOKEN"): print("Please set the GITHUB\_TOKEN environment variable.") print("Go to https://github.com/settings/tokens to create a token.") sys.exit(1) if len(sys.argv) <= 1: print(f"Usage: {sys.argv\[0\]} ...") sys.exit(2) main(sys.argv\[1:\]) --- # Unknown \--- title: "New option batch\_max\_wait\_time" date: 2022-01-05 tags: - Merge Queue description: "" --- Add the new option \[\`batch\_max\_wait\_time\`\](https://docs.mergify.com/actions/queue/#queue-rules) for queue. --- # Unknown \--- title: "New option disallow\_checks\_interruption\_from\_queue" date: 2022-03-08 tags: - Merge Queue description: "" --- Add the \[\`disallow\_checks\_interruption\_from\_queue\`\](https://docs.mergify.com/actions/queue/#queue-rules) option in the \`queue\` action. This allows to not interrupt pull requests treatment when a queue with a higher priority receives a new pull request. --- # Unknown \--- title: "\`requeue\` and \`unqueue\` commands" date: 2022-03-23 tags: - Merge Queue description: "" --- - Added the \[\`requeue\`\](https://docs.mergify.com/commands/#requeue) command. - Added the \[\`unqueue\`\](https://docs.mergify.com/commands/#unqueue) command. --- # Unknown \--- title: "Queue freeze feature" date: 2022-03-16 tags: - API - Merge Queue description: "" --- Add the \[queue freeze feature and API\](https://docs.mergify.com/actions/queue/#queue-freeze). --- # Unknown \--- 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\`. | Mergify posts \`message\` as a comment on the pull request after closing it, so the author reads the explanation on the pull request itself. Leave \`message\` out to get the default wording. ## 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. \`\`\` --- # Unknown ```json { "$defs": { "ActionsModel": { "additionalProperties": false, "properties": { "assign": { "anyOf": [ { "$ref": "#/$defs/AssignActionModel" }, { "type": "null" } ], "default": null }, "backport": { "anyOf": [ { "$ref": "#/$defs/BackportActionModel" }, { "type": "null" } ], "default": null }, "close": { "anyOf": [ { "$ref": "#/$defs/CloseActionModel" }, { "type": "null" } ], "default": null }, "comment": { "anyOf": [ { "$ref": "#/$defs/CommentActionModel" }, { "type": "null" } ], "default": null }, "copy": { "anyOf": [ { "$ref": "#/$defs/CopyActionModel" }, { "type": "null" } ], "default": null }, "delete_head_branch": { "anyOf": [ { "$ref": "#/$defs/DeleteHeadBranchActionModel" }, { "type": "null" } ], "default": null, "deprecated": true }, "dismiss_reviews": { "anyOf": [ { "$ref": "#/$defs/DismissReviewsActionModel" }, { "type": "null" } ], "default": null }, "edit": { "anyOf": [ { "$ref": "#/$defs/EditActionModel" }, { "type": "null" } ], "default": null }, "github_actions": { "anyOf": [ { "$ref": "#/$defs/GhaActionModel" }, { "type": "null" } ], "configuration_deprecated_attribute": { "deprecated_summary_ghes_mode": "The `github_actions` action will be removed on 2027-03-31: https://docs.mergify.com/workflow/actions/migrate-github-actions/", "deprecated_summary_saas_mode": "The `github_actions` action will be removed on 2027-03-31: https://docs.mergify.com/workflow/actions/migrate-github-actions/" }, "default": null, "deprecated": true }, "label": { "anyOf": [ { "$ref": "#/$defs/LabelActionModel" }, { "type": "null" } ], "default": null }, "merge": { "anyOf": [ { "$ref": "#/$defs/MergeActionModel" }, { "type": "null" } ], "default": null }, "post_check": { "anyOf": [ { "$ref": "#/$defs/PostCheckActionModel" }, { "type": "null" } ], "default": null, "deprecated": true }, "queue": { "anyOf": [ { "$ref": "#/$defs/QueueActionModel" }, { "type": "null" } ], "default": null }, "rebase": { "anyOf": [ { "$ref": "#/$defs/RebaseActionModel" }, { "type": "null" } ], "default": null }, "request_reviews": { "anyOf": [ { "$ref": "#/$defs/RequestReviewsActionModel" }, { "type": "null" } ], "default": null }, "review": { "anyOf": [ { "$ref": "#/$defs/ReviewActionModel" }, { "type": "null" } ], "default": null }, "squash": { "anyOf": [ { "$ref": "#/$defs/SquashActionModel" }, { "type": "null" } ], "default": null }, "update": { "anyOf": [ { "$ref": "#/$defs/UpdateActionModel" }, { "type": "null" } ], "default": null } }, "title": "Actions", "type": "object" }, "AndCondition": { "additionalProperties": false, "properties": { "and": { "$ref": "#/$defs/ListOfRuleConditions" } }, "required": [ "and" ], "title": "AndCondition", "type": "object" }, "AssignActionModel": { "additionalProperties": false, "properties": { "users": { "items": { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "User", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, "maxItems": 10, "title": "Users", "type": "array" }, "add_users": { "items": { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "User", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, "maxItems": 10, "title": "Add Users", "type": "array" }, "remove_users": { "items": { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "User", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, "maxItems": 40, "title": "Remove Users", "type": "array" } }, "title": "AssignActionModel", "type": "object" }, "AutoMergeConditionsModel": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/NegationCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ] }, "maxItems": 500, "type": "array" }, { "const": true } ], "title": "List of conditions" }, "BackportActionModel": { "additionalProperties": false, "properties": { "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to copy a pull request. If no `bot_account` is set, Mergify copies the pull request itself.", "title": "Bot Account" }, "branches": { "description": "The list of branches the pull request should be copied to.", "items": { "$ref": "#/$defs/BranchName" }, "maxItems": 30, "title": "Branches", "type": "array" }, "regexes": { "description": "The list of regexes to find branches the pull request should be copied to.", "items": { "format": "regex", "type": "string" }, "maxItems": 30, "title": "Regexes", "type": "array" }, "ignore_conflicts": { "default": true, "description": "Whether to create the pull requests even if there are conflicts when cherry-picking the commits.", "title": "Ignore Conflicts", "type": "boolean" }, "assignees": { "description": "Users to assign the newly created pull request to. Accepts a GitHub login, or `{{ author }}` (the original pull request author) or `{{ merged_by }}` (the user who merged it).", "items": { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`, `merged_by`.", "format": "simple-template", "title": "Assignee", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" }, { "description": "The login of the user who merged the pull request.", "name": "merged_by" } ] }, "maxItems": 10, "title": "Assignees", "type": "array" }, "labels": { "description": "The list of labels to add to the created pull requests.", "items": { "type": "string" }, "maxItems": 30, "title": "Labels", "type": "array" }, "label_conflicts": { "default": "conflicts", "description": "The label to add to the created pull request if it has conflicts and `ignore_conflicts` is set to `true`.", "title": "Label Conflicts", "type": "string" }, "title": { "default": "{{ title }} (backport #{{ number }})", "description": "The pull request's title.", "format": "simple-template", "title": "Title template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request title.", "name": "title" }, { "description": "The pull request number.", "name": "number" }, { "description": "The branch the pull request is copied to.", "name": "destination_branch" }, { "description": "The base branch name.", "name": "base" }, { "description": "The pull request author's login.", "name": "author" } ] }, "body": { "default": "{{ body }}
This is an automatic backport of pull request #{{number}} done by [Mergify](https://mergify.com).\n", "description": "The pull request's body.", "format": "simple-template", "title": "Body template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request title.", "name": "title" }, { "description": "The pull request number.", "name": "number" }, { "description": "The branch the pull request is copied to.", "name": "destination_branch" }, { "description": "The base branch name.", "name": "base" }, { "description": "The pull request author's login.", "name": "author" }, { "description": "The pull request description (body).", "name": "body" }, { "description": "The cherry-pick error message, when the copy hit a conflict (body only).", "name": "cherry_pick_error" }, { "description": "The cherry-picked commit SHAs, newline-joined.", "name": "cherry_picked_commits" } ] }, "report_mode": { "default": [ "check" ], "description": "Reporting modes for the action's result. Check will create a check on the pull request, and comment will post a comment on the pull request.", "items": { "$ref": "#/$defs/ReportMode" }, "minItems": 1, "title": "Report Mode", "type": "array" }, "merge_conflict_style": { "default": "merge", "description": "Style used by git when displaying merge conflicts", "enum": [ "merge", "diff3" ], "title": "Merge Conflict Style", "type": "string" } }, "title": "BackportActionModel", "type": "object" }, "BarrierFileFilters": { "additionalProperties": false, "properties": { "include": { "description": "Glob patterns of files that impact every scope. At least one pattern is required. Examples: ('.github/workflows/**', 'Makefile')", "items": { "type": "string" }, "minItems": 1, "title": "Include", "type": "array" }, "exclude": { "description": "Glob patterns of files to exclude from this scope. Evaluated after `include` and takes precedence. Examples: ('**/tests/**', '*.md')", "items": { "type": "string" }, "title": "Exclude", "type": "array" } }, "required": [ "include" ], "title": "BarrierFileFilters", "type": "object" }, "BatchSizeBounds": { "anyOf": [ { "maximum": 128, "minimum": 1, "type": "integer" }, { "additionalProperties": false, "properties": { "min": { "maximum": 128, "minimum": 1, "title": "Min", "type": "integer" }, "max": { "maximum": 128, "minimum": 1, "title": "Max", "type": "integer" } }, "required": [ "min", "max" ], "title": "BatchSizeBounds", "type": "object" } ] }, "BranchName": { "description": "A Git branch name.", "properties": {}, "title": "Branch Name", "type": "string" }, "CloseActionModel": { "additionalProperties": false, "properties": { "message": { "default": "This pull request has been automatically closed by Mergify.", "description": "A string with `{{ variable }}` placeholders. Allowed variables: `approvers`, `assignees`, `author`, `base`, `body`, `head`, `labels`, `number`, `queue_dequeue_reason`, `title`.", "format": "simple-template", "title": "Message template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" }, { "description": "The pull request number.", "name": "number" }, { "description": "The pull request title.", "name": "title" }, { "description": "The pull request description (body).", "name": "body" }, { "description": "The base branch name.", "name": "base" }, { "description": "The head branch name.", "name": "head" }, { "description": "The pull request's labels as a comma-separated list (e.g. `bug, feat`); empty when none.", "name": "labels" }, { "description": "Assignees as a ready-to-use @mention list (e.g. `@alice, @bob`); empty when none.", "name": "assignees" }, { "description": "Reviewers who approved, as a @mention list (e.g. `@alice, @bob`); empty when none.", "name": "approvers" }, { "description": "Why the pull request left the merge queue; empty outside queue contexts.", "name": "queue_dequeue_reason" } ] } }, "title": "CloseActionModel", "type": "object" }, "CommandRestrictionsConditionsModel": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/NegationCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ] }, "maxItems": 500, "type": "array" }, { "const": true } ], "title": "List of conditions" }, "CommandRestrictionsModel": { "additionalProperties": false, "properties": { "conditions": { "$ref": "#/$defs/CommandRestrictionsConditionsModel" } }, "title": "Command Restrictions", "type": "object" }, "CommandsRestrictionsRulesModel": { "additionalProperties": false, "properties": { "backport": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ "sender-permission >= write" ] } }, "copy": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ "sender-permission >= write" ] } }, "dequeue": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ "sender-permission >= write" ] } }, "queue": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ "sender-permission >= write" ] } }, "rebase": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ { "or": [ "sender-permission >= write", { "and": [ "sender = {{author}}", "from-fork" ] } ] } ] } }, "refresh": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ { "or": [ "sender-permission >= write", { "and": [ "sender = {{author}}", "from-fork" ] } ] } ] } }, "requeue": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ "sender-permission >= write" ] } }, "squash": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ { "or": [ "sender-permission >= write", { "and": [ "sender = {{author}}", "from-fork" ] } ] } ] } }, "update": { "$ref": "#/$defs/CommandRestrictionsModel", "default": { "conditions": [ { "or": [ "sender-permission >= write", { "and": [ "sender = {{author}}", "from-fork" ] } ] } ] } } }, "title": "CommandsRestrictionsRulesModel", "type": "object" }, "CommentActionModel": { "additionalProperties": false, "properties": { "message": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `approvers`, `assignees`, `author`, `base`, `body`, `head`, `labels`, `number`, `queue_dequeue_reason`, `title`.", "format": "simple-template", "title": "Message template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" }, { "description": "The pull request number.", "name": "number" }, { "description": "The pull request title.", "name": "title" }, { "description": "The pull request description (body).", "name": "body" }, { "description": "The base branch name.", "name": "base" }, { "description": "The head branch name.", "name": "head" }, { "description": "The pull request's labels as a comma-separated list (e.g. `bug, feat`); empty when none.", "name": "labels" }, { "description": "Assignees as a ready-to-use @mention list (e.g. `@alice, @bob`); empty when none.", "name": "assignees" }, { "description": "Reviewers who approved, as a @mention list (e.g. `@alice, @bob`); empty when none.", "name": "approvers" }, { "description": "Why the pull request left the merge queue; empty outside queue contexts.", "name": "queue_dequeue_reason" } ] }, { "type": "null" } ], "default": null, "description": "The message to write as a comment.", "title": "Message" }, "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to comment a pull request. If no `bot_account` is set, Mergify will comment the pull request itself.", "title": "Bot Account" } }, "title": "CommentActionModel", "type": "object" }, "Commit": { "properties": { "sha": { "title": "Sha", "type": "string" }, "parents": { "items": { "type": "string" }, "title": "Parents", "type": "array" }, "commit_message": { "title": "Commit Message", "type": "string" }, "commit_verification_verified": { "description": "Indicates if the commit has been marked as verified by GitHub", "title": "Commit Verification Verified", "type": "boolean" }, "author": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Name of the author", "title": "Author" }, "committer": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Name of the committer", "title": "Committer" }, "date_author": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Date Author" }, "date_committer": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Date Committer" }, "email_author": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Email Author" }, "email_committer": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Email Committer" }, "gh_author_login": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "GitHub login of the author", "title": "Gh Author Login" } }, "required": [ "sha", "parents", "commit_message", "commit_verification_verified", "author", "committer", "date_author", "date_committer", "email_author", "email_committer", "gh_author_login" ], "title": "Commit", "type": "object" }, "CommitAuthor": { "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Name of the author", "title": "Name" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Email address of the author", "title": "Email" } }, "required": [ "name", "email" ], "title": "CommitAuthor", "type": "object" }, "CommitMessageFormatModel": { "additionalProperties": false, "properties": { "title": { "default": "inherit", "enum": [ "inherit", "pr-title" ], "title": "Title", "type": "string" }, "body": { "default": "inherit", "enum": [ "inherit", "pr-body", "empty" ], "title": "Body", "type": "string" }, "trailers": { "items": { "enum": [ "co-authored-by", "approved-by", "merged-by" ], "type": "string" }, "title": "Trailers", "type": "array" } }, "title": "CommitMessageFormatModel", "type": "object" }, "ConflictResolverModel": { "additionalProperties": false, "properties": { "paths": { "description": "Glob patterns of the files this resolver applies to, matched against the path from the repository root exactly like `scopes` file patterns. `*` does not cross a `/`, so `*.md` matches only Markdown files at the root, and `docs/*.md` only those directly in `docs/` -- unlike `.gitattributes`, where a pattern with no `/` matches at any depth. `**` matches any number of directories, and `{a,b}` either alternative.", "items": { "type": "string" }, "minItems": 1, "title": "Paths", "type": "array" }, "strategy": { "description": "How to merge a matching file when two pull requests of the same batch both change it. The names follow git's merge drivers. `ours` is always what the batch already holds, the base branch plus the pull requests queued ahead, and never the incoming pull request:\n\n- `union`: keep both sides' conflicting lines, ours first. For append-only files such as a changelog.\n- `ours`: keep our whole file and discard the incoming pull request's change to it, even where the two changes did not conflict.\n- `theirs`: take the incoming pull request's whole file and discard ours, even where the two changes did not conflict.\n- `prefer-ours`: merge normally, and keep our side only on the lines that conflict.\n- `prefer-theirs`: merge normally, and keep the incoming pull request's side only on the lines that conflict.\n\nA conflict on any other file still removes the pull request from the batch.", "enum": [ "union", "ours", "theirs", "prefer-ours", "prefer-theirs" ], "title": "Strategy", "type": "string", "x-mergify-enum": [ { "description": "Keep both sides' lines where they conflict, the batch's first.", "facts": { "discards": null, "kind": "git-builtin", "options": {}, "resolves_binary": false, "suits": [ "append-only" ] } }, { "description": "Keep the batch's whole file and discard the incoming pull request's change to it, even where the two did not conflict.", "facts": { "discards": { "scope": "whole-file", "side": "theirs" }, "kind": "driver", "options": {}, "resolves_binary": true, "suits": [] } }, { "description": "Take the incoming pull request's whole file and discard the batch's, even where the two did not conflict.", "facts": { "discards": { "scope": "whole-file", "side": "ours" }, "kind": "driver", "options": {}, "resolves_binary": true, "suits": [] } }, { "description": "Merge normally, and keep the batch's side only on the lines that conflict -- its whole file when both sides added the file.", "facts": { "discards": { "scope": "conflicting-lines", "side": "theirs" }, "kind": "driver", "options": {}, "resolves_binary": false, "suits": [] } }, { "description": "Merge normally, and keep the incoming pull request's side only on the lines that conflict -- its whole file when both sides added the file.", "facts": { "discards": { "scope": "conflicting-lines", "side": "ours" }, "kind": "driver", "options": {}, "resolves_binary": false, "suits": [] } } ] } }, "required": [ "paths", "strategy" ], "title": "ConflictResolverModel", "type": "object" }, "CopyActionModel": { "additionalProperties": false, "properties": { "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to copy a pull request. If no `bot_account` is set, Mergify copies the pull request itself.", "title": "Bot Account" }, "branches": { "description": "The list of branches the pull request should be copied to.", "items": { "$ref": "#/$defs/BranchName" }, "maxItems": 30, "title": "Branches", "type": "array" }, "regexes": { "description": "The list of regexes to find branches the pull request should be copied to.", "items": { "format": "regex", "type": "string" }, "maxItems": 30, "title": "Regexes", "type": "array" }, "ignore_conflicts": { "default": true, "description": "Whether to create the pull requests even if there are conflicts when cherry-picking the commits.", "title": "Ignore Conflicts", "type": "boolean" }, "assignees": { "description": "Users to assign the newly created pull request to. Accepts a GitHub login, or `{{ author }}` (the original pull request author) or `{{ merged_by }}` (the user who merged it).", "items": { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`, `merged_by`.", "format": "simple-template", "title": "Assignee", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" }, { "description": "The login of the user who merged the pull request.", "name": "merged_by" } ] }, "maxItems": 10, "title": "Assignees", "type": "array" }, "labels": { "description": "The list of labels to add to the created pull requests.", "items": { "type": "string" }, "maxItems": 30, "title": "Labels", "type": "array" }, "label_conflicts": { "default": "conflicts", "description": "The label to add to the created pull request if it has conflicts and `ignore_conflicts` is set to `true`.", "title": "Label Conflicts", "type": "string" }, "title": { "default": "{{ title }} (copy #{{ number }})", "description": "The pull request's title.", "format": "simple-template", "title": "Title template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request title.", "name": "title" }, { "description": "The pull request number.", "name": "number" }, { "description": "The branch the pull request is copied to.", "name": "destination_branch" }, { "description": "The base branch name.", "name": "base" }, { "description": "The pull request author's login.", "name": "author" } ] }, "body": { "default": "{{ body }}
This is an automatic copy of pull request #{{number}} done by [Mergify](https://mergify.com).\n", "description": "The pull request's body.", "format": "simple-template", "title": "Body template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request title.", "name": "title" }, { "description": "The pull request number.", "name": "number" }, { "description": "The branch the pull request is copied to.", "name": "destination_branch" }, { "description": "The base branch name.", "name": "base" }, { "description": "The pull request author's login.", "name": "author" }, { "description": "The pull request description (body).", "name": "body" }, { "description": "The cherry-pick error message, when the copy hit a conflict (body only).", "name": "cherry_pick_error" }, { "description": "The cherry-picked commit SHAs, newline-joined.", "name": "cherry_picked_commits" } ] }, "report_mode": { "default": [ "check" ], "description": "Reporting modes for the action's result. Check will create a check on the pull request, and comment will post a comment on the pull request.", "items": { "$ref": "#/$defs/ReportMode" }, "minItems": 1, "title": "Report Mode", "type": "array" }, "merge_conflict_style": { "default": "merge", "description": "Style used by git when displaying merge conflicts", "enum": [ "merge", "diff3" ], "title": "Merge Conflict Style", "type": "string" } }, "title": "CopyActionModel", "type": "object" }, "DefaultsRulesModel": { "additionalProperties": false, "properties": { "actions": { "$ref": "#/$defs/ActionsModel" }, "queue_rule": { "anyOf": [ { "$ref": "#/$defs/QueueRuleModelForDefaults" }, { "type": "null" } ], "default": null } }, "title": "DefaultsRulesModel", "type": "object" }, "DeleteHeadBranchActionModel": { "additionalProperties": false, "properties": { "force": { "default": false, "description": "If set to `true`, the branch will be deleted even if another pull request depends on the head branch. GitHub will therefore close the dependent pull requests.", "title": "Force", "type": "boolean" } }, "title": "DeleteHeadBranchActionModel", "type": "object" }, "DisabledDict": { "additionalProperties": false, "properties": { "reason": { "title": "Reason", "type": "string" } }, "required": [ "reason" ], "title": "DisabledDict", "type": "object" }, "DismissReviewsActionModel": { "additionalProperties": false, "properties": { "approved": { "anyOf": [ { "items": { "type": "string" }, "maxItems": 50, "type": "array" }, { "type": "boolean" }, { "const": "from_requested_reviewers", "type": "string" } ], "default": true, "description": "If set to `true`, all the approving reviews will be removed when the pull request is updated. If set to `false`, nothing will be done. If set to a list, each item should be the GitHub login of a user whose review will be removed. If set to `from_requested_reviewers`, the list of requested reviewers will be used to get whose review will be removed.", "title": "Approved" }, "changes_requested": { "anyOf": [ { "items": { "type": "string" }, "maxItems": 50, "type": "array" }, { "type": "boolean" }, { "const": "from_requested_reviewers", "type": "string" } ], "default": true, "description": "If set to `true`, all the reviews requesting changes will be removed when the pull request is updated. If set to false, nothing will be done. If set to a list, each item should be the GitHub login of a user whose review will be removed. If set to `from_requested_reviewers`, the list of requested reviewers will be used to get whose review will be removed.", "title": "Changes Requested" }, "message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Message to use when dismissing reviews.", "title": "Message" }, "when": { "default": "synchronize", "description": "If set to `synchronize`, the action will run only if the pull request commits changed. Otherwise, it will run each time the rule matches.", "enum": [ "synchronize", "always" ], "title": "When", "type": "string" } }, "title": "DismissReviewsActionModel", "type": "object" }, "EditActionModel": { "additionalProperties": false, "properties": { "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to edit a pull request. If no `bot_account` is set, Mergify will edit the pull request itself.", "title": "Bot Account" }, "draft": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "If the pull request should be a draft (true) or the other way around (false).", "title": "Draft" } }, "title": "EditActionModel", "type": "object" }, "FileFilters": { "additionalProperties": false, "properties": { "include": { "description": "Glob patterns of files to include for this scope. Empty means 'include everything' before exclusions. Examples: ('src/**/*.py', 'Makefile')", "items": { "type": "string" }, "title": "Include", "type": "array" }, "exclude": { "description": "Glob patterns of files to exclude from this scope. Evaluated after `include` and takes precedence. Examples: ('**/tests/**', '*.md')", "items": { "type": "string" }, "title": "Exclude", "type": "array" } }, "title": "FileFilters", "type": "object" }, "GhaActionModel": { "additionalProperties": false, "properties": { "workflow": { "$ref": "#/$defs/GhaActionModelWorkflow" } }, "required": [ "workflow" ], "title": "GhaActionModel", "type": "object" }, "GhaActionModelDispatch": { "additionalProperties": false, "description": "GitHub Actions workflow dispatch", "properties": { "workflow": { "description": "The GitHub Workflow file name with its extension (e.g. `ci.yml`), or the numeric workflow id.", "title": "Workflow", "type": "string" }, "ref": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The reference to use when triggering the job. If none is passed, the default repository branch is used.", "title": "Ref" }, "inputs": { "additionalProperties": { "anyOf": [ { "type": "integer" }, { "type": "boolean" }, { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`, `base`, `head`, `number`, `repository_full_name`, `title`.", "format": "simple-template", "title": "Workflow input template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" }, { "description": "The pull request number.", "name": "number" }, { "description": "The pull request title.", "name": "title" }, { "description": "The base branch name.", "name": "base" }, { "description": "The head branch name.", "name": "head" }, { "description": "The repository's full name (`owner/repo`).", "name": "repository_full_name" } ] } ] }, "description": "The inputs passed to your workflow execution if any. Values can be either a template, a number or a Boolean.", "maxProperties": 10, "title": "Inputs", "type": "object" } }, "required": [ "workflow" ], "title": "Workflow Action Dispatch", "type": "object" }, "GhaActionModelWorkflow": { "additionalProperties": false, "description": "GitHub Actions workflow action", "properties": { "dispatch": { "description": "The list of workflows to dispatch via the action.", "items": { "$ref": "#/$defs/GhaActionModelDispatch" }, "maxItems": 10, "title": "Dispatch", "type": "array" } }, "title": "Workflow Action", "type": "object" }, "GitHubRepositoryPermission": { "enum": [ "none", "read", "triage", "write", "maintain", "admin" ], "title": "GitHubRepositoryPermission", "type": "string" }, "LabelActionModel": { "additionalProperties": false, "description": "Add or remove labels on a pull request.", "properties": { "add": { "description": "The list of labels to add.", "items": { "type": "string" }, "maxItems": 50, "title": "Add", "type": "array" }, "remove": { "description": "The list of labels to remove.", "items": { "type": "string" }, "maxItems": 50, "title": "Remove", "type": "array" }, "remove_all": { "default": false, "description": "Remove all labels from the pull request.", "title": "Remove All", "type": "boolean" }, "toggle": { "description": "Toggle labels in the list based on the conditions. If all the conditions are a success, all the labels in the list will be added, otherwise, they will all be removed.", "items": { "type": "string" }, "maxItems": 50, "title": "Toggle", "type": "array" } }, "title": "LabelActionModel", "type": "object" }, "ListOfRuleConditions": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/NegationCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ] }, "maxItems": 500, "type": "array" }, { "const": true } ], "title": "List of conditions" }, "MergeActionModel": { "additionalProperties": false, "properties": { "method": { "anyOf": [ { "enum": [ "merge", "rebase", "squash", "fast-forward" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "Merge method to use. If no value is set, Mergify uses the first authorized method available in the repository configuration.", "title": "Method" }, "merge_bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to merge pull requests. If no `merge_bot_account` is set, Mergify merges the pull request itself. The user account **must** have already been logged in Mergify dashboard once and have **write** or **maintain** permission.", "title": "Merge Bot Account" }, "commit_message_template": { "anyOf": [ { "description": "A string template using the Jinja2 syntax.", "format": "template", "title": "Template", "type": "string" }, { "type": "null" } ], "configuration_deprecated_attribute": { "deprecated_summary_ghes_mode": "`commit_message_template` is deprecated and will be removed on 2026-09-30. Use the declarative `commit_message_format` instead: https://docs.mergify.com/workflow/actions/merge#migrating-from-commit_message_template", "deprecated_summary_saas_mode": "`commit_message_template` is deprecated and will be removed on 2026-09-30. Use the declarative `commit_message_format` instead: https://docs.mergify.com/workflow/actions/merge#migrating-from-commit_message_template" }, "default": null, "deprecated": true, "description": "Template to use as the commit message when using the merge or squash merge method. Deprecated: use `commit_message_format` instead.", "title": "Commit Message Template" }, "commit_message_format": { "anyOf": [ { "$ref": "#/$defs/CommitMessageFormatModel" }, { "type": "null" } ], "default": null, "description": "Declarative commit message format configuration. Use this instead of the Jinja2 `commit_message_template` for the common merge-commit shapes. Mutually exclusive with `commit_message_template` on the same rule." } }, "title": "MergeActionModel", "type": "object" }, "MergeProtectionRuleConditionsModel": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/NegationCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ] }, "maxItems": 500, "type": "array" }, { "const": true } ], "title": "List of conditions" }, "MergeProtectionRuleModel": { "additionalProperties": false, "properties": { "name": { "description": "The name of the rule", "title": "Name", "type": "string" }, "if": { "$ref": "#/$defs/MergeProtectionRuleConditionsModel", "description": "The conditions to check before applying the rule" }, "success_conditions": { "$ref": "#/$defs/MergeProtectionRuleConditionsModel", "description": "The conditions to check to validate the rule" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "A description of the rule", "title": "Description" } }, "required": [ "name", "if", "success_conditions" ], "title": "MergeProtectionRuleModel", "type": "object" }, "MergeProtectionRulesModel": { "items": { "$ref": "#/$defs/MergeProtectionRuleModel" }, "maxItems": 100, "title": "MergeProtectionRulesModel", "type": "array" }, "MergeProtections": { "additionalProperties": false, "properties": { "reporting_method": { "default": "check-runs", "description": "The merge protection reporting method", "enum": [ "check-runs", "deployments" ], "title": "Reporting Method", "type": "string" }, "post_comment": { "default": true, "description": "Whether to post merge protection status comments on pull requests", "title": "Post Comment", "type": "boolean" }, "auto_merge": { "default": false, "deprecated": true, "description": "Automatically merge or queue PRs when all merge protection conditions pass. Deprecated: use auto_merge_conditions.", "title": "Auto Merge", "type": "boolean" }, "auto_merge_conditions": { "anyOf": [ { "$ref": "#/$defs/AutoMergeConditionsModel" }, { "type": "null" } ], "default": null, "description": "Conditions that gate auto-merge. Accepts `true` as shorthand for unconditional auto-merge, or a list of conditions to restrict the audience. Omit the field to disable auto-merge." } }, "title": "MergeProtections", "type": "object" }, "MergeQueue": { "additionalProperties": false, "properties": { "max_parallel_checks": { "default": 5, "description": "The maximum number of speculative checks allowed to run at the same time. Setting this value to 1 disables speculative checks.", "maximum": 128, "minimum": 1, "title": "Max Parallel Checks", "type": "integer" }, "reset_on_external_merge": { "default": "always", "description": "Defines the behavior of the merge queue when something is merged outside of the queue.\n\"always\": The queue is reset when an external merge is detected. All queued pull requests are re-evaluated to ensure correctness based on the new base branch state.\n\"never\": The queue remains unchanged. It does not reset or re-evaluate based on the external merge.\n", "enum": [ "never", "always" ], "title": "Reset On External Merge", "type": "string" }, "queued_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "queued", "description": "The label to add on pull requests when they are added to the merge queue.", "title": "Queued Label" }, "checking_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The label to add on pull requests while the merge queue is checking them, from the moment they enter a batch until they leave the queue. It stays on a pull request parked in a bisection, whose own CI has not started yet.", "title": "Checking Label" }, "dequeued_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "dequeued", "description": "The label to add on pull requests when they are removed from the merge queue.", "title": "Dequeued Label" }, "mode": { "default": "serial", "description": "Defines how the merge queue schedules pull requests.\n- `serial`: PRs are tested cumulatively.\n- `parallel`: PRs whose scopes don't overlap are tested in parallel.\n- `isolated`: PRs are grouped into batches by changed-files similarity; each batch runs as a fully isolated batch, with no dependency on any other batch.\n", "enum": [ "serial", "parallel", "isolated" ], "title": "Mode", "type": "string" }, "skip_intermediate_results": { "default": false, "description": "Allow PRs to merge even if their own speculative check fails, as long as a later downstream check including them passes and schedule conditions are valid.", "title": "Skip Intermediate Results", "type": "boolean" }, "status_comments": { "default": "all", "description": "Controls the level of status comments posted on pull requests in the queue.\n- `all`: Post comments for all queue events (entering queue, CI progress, outcomes).\n- `outcomes`: Only post comments for final outcomes (merged or dequeued with failure reason).\n- `none`: Do not post any comments for queue status.\n", "enum": [ "all", "outcomes", "none" ], "title": "Status Comments", "type": "string" }, "queue_controls_comment": { "default": true, "description": "When enabled, Mergify renders task-list checkboxes a developer can tick instead of typing `@mergifyio queue`. The two controls live in different comments.\n- `Queue this pull request`: a comment of its own, posted before the pull request is queued.\n- `Requeue this pull request`: part of the Merge Queue status comment, after the pull request has left the queue, unless the queue merged it.\n", "title": "Queue Controls Comment", "type": "boolean" } }, "title": "MergeQueue", "type": "object" }, "NegationCondition": { "additionalProperties": false, "properties": { "not": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ], "title": "Not" } }, "required": [ "not" ], "title": "NegationCondition", "type": "object" }, "OrCondition": { "additionalProperties": false, "properties": { "or": { "$ref": "#/$defs/ListOfRuleConditions" } }, "required": [ "or" ], "title": "OrCondition", "type": "object" }, "PostCheckActionModel": { "additionalProperties": false, "properties": { "title": { "default": "'{{ check_rule_name }}'{% if check_status == 'success' %} succeeded{% elif check_status == 'failure' %} failed{% endif %}", "description": "The title of the check.", "format": "template", "title": "Template", "type": "string" }, "summary": { "default": "{{ check_conditions }}", "description": "The summary of the check.", "format": "template", "title": "Template", "type": "string" }, "success_conditions": { "anyOf": [ { "$ref": "#/$defs/ListOfRuleConditions" }, { "type": "null" } ], "default": null, "description": "List of conditions to match to mark the pull request check as succeeded, otherwise, it will be marked as failing. If unset, the conditions from the rule that triggers this action are used." }, "neutral_conditions": { "anyOf": [ { "$ref": "#/$defs/ListOfRuleConditions" }, { "type": "null" } ], "default": null, "description": "List of conditions to match to mark the pull request check as neutral, otherwise, it will be marked as failing." } }, "title": "PostCheckActionModel", "type": "object" }, "PriorityRuleConditionsModel": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/NegationCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ] }, "maxItems": 500, "type": "array" }, { "const": true } ], "title": "List of conditions" }, "PriorityRuleModel": { "additionalProperties": false, "properties": { "name": { "description": "Name of the rule.", "title": "Name", "type": "string" }, "conditions": { "$ref": "#/$defs/PriorityRuleConditionsModel", "description": "The list of conditions that needs to match to assign priority to the pull request." }, "priority": { "anyOf": [ { "enum": [ "high", "medium", "low" ], "type": "string" }, { "type": "integer" } ], "default": "medium", "description": "The priority of the pull request.", "title": "Priority", "x-mergify-has-data-type": true }, "allow_checks_interruption": { "default": false, "description": "Allow interrupting the ongoing checks when the pull request entering the queue has a higher priority than the queued one(s). If set to false, a pull request with higher priority will be inserted just after the pull requests that have checks running.", "title": "Allow Checks Interruption", "type": "boolean" } }, "required": [ "name", "conditions" ], "title": "PriorityRuleModel", "type": "object" }, "PriorityRulesModel": { "items": { "$ref": "#/$defs/PriorityRuleModel" }, "maxItems": 50, "title": "PriorityRulesModel", "type": "array" }, "PullRequestAttributes": { "properties": { "draft": { "description": "Whether the pull request is in draft state.", "title": "Draft", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "merged": { "description": "Whether the pull request is merged.", "title": "Merged", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "mergify-configuration-changed": { "description": "Whether the pull request contains changes in the configuration file.", "title": "Mergify configuration changed", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "closed": { "description": "Whether the pull request is closed.", "title": "Closed", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "locked": { "description": "Whether the pull request is locked.", "title": "Locked", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "linear-history": { "description": "Whether the pull request commits history is linear (no merge commit).", "title": "Linear history", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "conflict": { "description": "Whether the pull request is conflicting with its base branch.", "title": "Conflict", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "github-review-decision": { "anyOf": [ { "enum": [ "APPROVED", "CHANGES_REQUESTED", "REVIEW_REQUIRED" ], "type": "string" }, { "type": "null" } ], "description": "The review decision computed by GitHub from its `pullRequest.reviewDecision` field, driven by either classic branch protection or repository / organization rulesets. Typically reflects whether required approvals and `CODEOWNERS` reviews have been satisfied.", "title": "GitHub review decision", "x-allowed-operators": [ "=", "!=", "~=" ], "x-mergify-attribute-metadata": { "documentation_url": "https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-pull-request-reviews-before-merging", "source": "github" }, "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "github-require-review-from-specific-teams": { "description": "Whether every `required_reviewers` entry on the branch's active GitHub rulesets is satisfied (each named team has the requested number of approvals, each named user has approved). When the rule scopes the requirement to a subset of files via `file_patterns`, the check only applies to PRs that touch a matching file. Returns `false` if an entry references a team or user id that cannot be resolved.", "title": "GitHub require review from specific teams", "type": "boolean", "x-allowed-operators": [], "x-mergify-attribute-metadata": { "documentation_url": "https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#required-reviewers", "source": "github" }, "x-modifiers": [ { "type": "negate" } ] }, "github-code-owner-review-satisfied": { "description": "Whether every file the pull request touches that is owned in the repository's `CODEOWNERS` file has at least one approval from one of its owners (a user, or any member of an owning team). Mirrors GitHub's 'Require review from Code Owners', covering the case where GitHub blocks the merge on a code-owner review while `pullRequest.reviewDecision` is `null`. Returns `true` when there is no `CODEOWNERS` file or no touched file is owned, and `false` when an owner cannot be resolved to a GitHub login (an email address, or a team in another org).", "title": "GitHub code owner review satisfied", "type": "boolean", "x-allowed-operators": [], "x-mergify-attribute-metadata": { "documentation_url": "https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners", "source": "github" }, "x-modifiers": [ { "type": "negate" } ] }, "github-review-approved": { "description": "Whether GitHub's effective review enforcement is satisfied: the required approvals are in and no eligible reviewer is blocking with an active 'Request changes'. When the rule requires at least one approval, this mirrors GitHub's `pullRequest.reviewDecision` (so a blocking review from a reviewer other than the approver is honored, unlike a bare approval count). When the rule requires a pull request with no approval count, it blocks only on a write+ reviewer's active 'Request changes'. Returns `true` when no rule on the base branch requires a review.", "title": "GitHub review approved", "type": "boolean", "x-allowed-operators": [], "x-mergify-attribute-metadata": { "documentation_url": "https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-pull-request-reviews-before-merging", "source": "github" }, "x-modifiers": [ { "type": "negate" } ] }, "github-require-last-push-approval": { "description": "Whether GitHub's 'Require approval of the most recent reviewable push' is satisfied: the required number of approvals are in from reviewers other than the user who pushed the most recent commit, and approvals submitted against an earlier head no longer count. Mirrors how GitHub's `pullRequest.reviewDecision` evaluates the `require_last_push_approval` branch protection / ruleset option. Returns `true` when no rule on the base branch requires last-push approval, and (leniently) when Mergify has not recorded the most recent push, such as pull requests opened before push tracking.", "title": "GitHub require last push approval", "type": "boolean", "x-allowed-operators": [], "x-mergify-attribute-metadata": { "documentation_url": "https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-pull-request-reviews-before-merging", "source": "github" }, "x-modifiers": [ { "type": "negate" } ] }, "number": { "description": "The pull request number.", "maximum": 9223372036854775807, "minimum": 0, "title": "Number", "type": "integer", "x-allowed-operators": [ "=", "!=", ">=", "<=", "<", ">" ], "x-modifiers": [ { "type": "negate" } ] }, "queue-position": { "description": "The position of the pull request in its queue if queued. The first pull request in the queue has position 0. The value is set to -1 if the pull request is not queued.", "title": "Queue position", "type": "integer", "x-allowed-operators": [ "=", "!=", ">=", "<=", "<", ">" ], "x-modifiers": [ { "type": "negate" } ] }, "author": { "description": "The GitHub user or team login of the author of the pull request.", "title": "Author", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "merged-by": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "The GitHub user that merged the pull request.", "title": "Merged by", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "merge-commit-sha": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "The merge commit SHA of the pull request returned by GitHub.", "title": "Merge commit sha", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "milestone": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "The milestone title associated to the pull request.", "title": "Milestone", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "base": { "description": "The name of the branch the pull request should be pulled into.", "title": "Base", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "head": { "description": "The name of the branch where the pull request changes are implemented.", "title": "Head", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "head-repo-full-name": { "description": "The head branch repository full name (complete version with the organization name).", "title": "Head repo full name", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "from-fork": { "description": "Whether the pull request comes from a fork, i.e. its head branch and its base branch live in different repositories. Also `true` when the head repository has been deleted, since a deleted repository is never the one holding the base branch.", "title": "From fork", "type": "boolean", "x-allowed-operators": [], "x-modifiers": [ { "type": "negate" } ] }, "title": { "description": "The title of the pull request.", "title": "Title", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "body": { "description": "The content of the pull request description without Markdown/HTML comments.", "title": "Body", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "body-raw": { "description": "The content of the pull request description.", "title": "Body raw", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "repository-name": { "description": "The current repository name (short version without the organization name).", "title": "Repository name", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "repository-full-name": { "description": "The current repository full name (complete version with the organization name).", "title": "Repository full name", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "queue-dequeue-reason": { "anyOf": [ { "enum": [ "NONE", "PR_MERGED", "PR_MERGED_INTERMEDIATE_RESULTS_SKIPPED", "PR_DEQUEUED", "PR_DEQUEUED_FROM_PARTITION", "PR_AHEAD_DEQUEUED", "BATCH_AHEAD_FAILED", "PR_WITH_HIGHER_PRIORITY_QUEUED", "SCHEDULED_FREEZE_STATUS_CHANGED", "SPECULATIVE_CHECK_NUMBER_REDUCED", "CHECKS_TIMEOUT", "CHECKS_FAILED", "DROPPED_BY_BISECTION_ELIMINATION", "QUEUE_RULE_MISSING", "BASE_BRANCH_MISSING", "BASE_BRANCH_CHANGED", "PR_UNEXPECTEDLY_FAILED_TO_MERGE", "BATCH_MAX_FAILURE_RESOLUTION_ATTEMPTS", "PR_CHECKS_STOPPED_BECAUSE_MERGE_QUEUE_PAUSE", "CONFLICT_WITH_BASE_BRANCH", "CONFLICT_WITH_PULL_AHEAD", "BRANCH_UPDATE_FAILED", "DRAFT_PULL_REQUEST_CHANGED", "BATCH_PULL_REQUEST_CLOSED", "PULL_REQUEST_UPDATED", "MERGE_QUEUE_RESET", "INCOMPATIBILITY_WITH_BRANCH_PROTECTIONS", "PR_MANUALLY_MERGED", "DRAFT_PULL_REQUEST_CREATION_FAILED", "DRAFT_PULL_REQUEST_CREATION_BRANCH_NOT_INDEXED", "CONFIGURATION_CHANGED", "UNPROCESSABLE_PULL_REQUEST", "PR_MANUALLY_DEQUEUED", "STACK_PREDECESSOR_DEQUEUED", "INTERMEDIATE_RESULTS_SKIPPED", "CHECKS_RETRIED", "SCHEDULE_BLOCKED_AHEAD_YIELDED", "BASE_REF_ALIGNMENT_TIMEOUT", "GITHUB_STACKED_PULL_REQUEST_MERGE_UNSUPPORTED", "BATCH_SCOPES_CHANGED", "BATCH_AHEAD_BRANCH_EDITED", "CHECKS_INTERRUPTED", "GITHUB_WORKFLOWS_PERMISSION_MISSING" ], "type": "string" }, { "type": "null" } ], "description": "The code identifying why a pull request's merge queue checks ended \u2014 the pull request may have left the queue, or had its checks interrupted while staying in the queue.", "title": "Queue dequeue reason", "x-allowed-operators": [ "=", "!=", "~=" ], "x-mergify-enum": [ { "description": "The pull request is not, and never was, in a merge queue." }, { "description": "The pull request was merged by the merge queue." }, { "description": "The pull request was merged based on the successful result of a later pull request in the same speculative batch, skipping its own intermediate checks." }, { "description": "The pull request was removed from the queue, for example because its queue conditions no longer match." }, { "description": "The pull request stopped matching a partition's rules and was removed from that partition." }, { "description": "A pull request ahead in the queue was removed, so this pull request's speculative checks are restarted. It stays in the queue." }, { "description": "A batch ahead in the queue failed, so this pull request's speculative checks are restarted. It stays in the queue." }, { "description": "A higher-priority pull request was queued ahead of this one. It stays in the queue." }, { "description": "A scheduled queue freeze changed the freeze status of the batch's pull requests, so the batch was split. It stays in the queue." }, { "description": "The number of speculative checks was reduced. The pull request stays in the queue." }, { "description": "The `checks_timeout` was reached before the queue conditions were satisfied. Unless the queue configures it, that timeout is derived from the queue's recent CI runtime." }, { "description": "The queue conditions cannot be satisfied because required checks failed." }, { "description": "Batch bisection isolated the failure to other pull requests and dropped this one without testing it individually." }, { "description": "The queue rule referenced by the pull request no longer exists in the configuration." }, { "description": "The pull request's base branch no longer exists." }, { "description": "The pull request's base branch changed." }, { "description": "An unexpected error happened while merging the pull request." }, { "description": "The maximum number of `batch_max_failure_resolution_attempts` was reached while isolating a batch failure." }, { "description": "The pull request's checks were interrupted because the merge queue is paused on the repository. It stays in the queue." }, { "description": "The pull request conflicts with its base branch." }, { "description": "The pull request conflicts with a pull request ahead of it in the queue." }, { "description": "Updating the pull request's head branch failed." }, { "description": "The merge queue draft pull request received commits that Mergify did not create." }, { "description": "The merge queue batch pull request was closed." }, { "description": "The pull request was manually updated." }, { "description": "The merge queue was reset." }, { "description": "The pull request cannot be checked because of an incompatibility between the queue and the repository's branch protections." }, { "description": "The pull request was merged manually, outside of the merge queue." }, { "description": "Mergify could not create the merge queue draft pull request." }, { "description": "Mergify could not create the merge queue draft pull request because GitHub had not yet indexed the new branch." }, { "description": "The Mergify configuration changed while the pull request was queued." }, { "description": "Mergify cannot process the pull request, for example because it has too many check runs, comments, or files." }, { "description": "The pull request was manually removed from the queue." }, { "description": "A predecessor pull request in the same stack was dequeued, so this one was removed as well." }, { "description": "The pull request's intermediate speculative results were skipped. It stays in the queue." }, { "description": "The pull request's failed checks are being retried. It stays in the queue." }, { "description": "A pull request ahead that was waiting for its merge schedule yielded its position so ready pull requests behind it can merge first. It stays in the queue." }, { "description": "The pull request could not be retargeted onto the queue base branch, for example a stacked pull request GitHub never retargeted." }, { "description": "The pull request is a GitHub stacked pull request, which GitHub does not support merging through its API." }, { "description": "A pull request's scopes changed after it was embarked, so its batch was recomposed. It stays in the queue." }, { "description": "A commit was pushed to the branch of a batch ahead in the queue, which `allow_queue_branch_edit` permits, so this pull request's speculative checks are restarted on top of it. It stays in the queue." }, { "description": "A required check was cancelled before producing a result, so the queue conditions cannot be satisfied. The check says nothing about the pull request; requeueing runs it again." }, { "description": "GitHub refused to write the pull request's changes under `.github/workflows/` because Mergify lacks the `workflows` permission." } ], "x-mergify-has-data-type": true, "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "queue-name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "The name of the queue containing the pull request.", "title": "Queue name", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "assignee": { "description": "The list of GitHub user or team login that are assigned to the pull request. Team logins are prefixed with the `@` character and must belong to the repository organization.", "items": { "type": "string" }, "title": "Assignee", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "label": { "description": "The list of labels of the pull request.", "items": { "type": "string" }, "title": "Label", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "review-requested": { "description": "The list of GitHub user or team login that were requested to review the pull request. Team logins are prefixed with the @ character. This only matches reviewers with `admin`, `write` or `maintain` permission on the repository.", "items": { "type": "string" }, "title": "Review requested", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "approved-reviews-by": { "description": "The list of GitHub user or team login that approved the pull request. Team logins are prefixed with the `@` character and must belong to the repository organization. This only matches reviewers with `admin`, `write` or `maintain` permission on the repository.", "items": { "type": "string" }, "title": "Approved reviews by", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "dismissed-reviews-by": { "description": "The list of GitHub user login that have their review dismissed in the pull request.", "items": { "type": "string" }, "title": "Dismissed reviews by", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "changes-requested-reviews-by": { "description": "The list of GitHub user or team login that have requested changes in a review for the pull request.", "items": { "type": "string" }, "title": "Changes requested reviews by", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "commented-reviews-by": { "description": "The list of GitHub user that have commented in a review for the pull request. This only matches reviewers with `admin`, `write` or `maintain` permission on the repository.", "items": { "type": "string" }, "title": "Commented reviews by", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check-success": { "description": "The list of checks that successfully passed for the pull request.", "items": { "type": "string" }, "title": "Check success", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check-failure": { "description": "The list of checks that failed for the pull request. Checks that report being cancelled, timed out, and action required are also considered as failures.", "items": { "type": "string" }, "title": "Check failure", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check-neutral": { "description": "The list of checks that are neutral for the pull request. ", "items": { "type": "string" }, "title": "Check neutral", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check-timed-out": { "description": "The list of checks that timed out for the pull request.", "items": { "type": "string" }, "title": "Check timed out", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check-skipped": { "description": "The list of checks that was skipped for the pull request.", "items": { "type": "string" }, "title": "Check skipped", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check-cancelled": { "description": "The list of checks that were cancelled for the pull request. Cancelled checks are also matched by `check-failure`; use `check-cancelled` to address them independently.", "items": { "type": "string" }, "title": "Check cancelled", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check-pending": { "description": "The list of checks that are pending for the pull request.", "items": { "type": "string" }, "title": "Check pending", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "check": { "description": "The list of checks for that pull request.", "items": { "type": "string" }, "title": "Check", "type": "array" }, "check-stale": { "description": "The list of checks that are stale for the pull request.", "items": { "type": "string" }, "title": "Check stale", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "commits-unverified": { "description": "The list of commit messages that are marked as unverified by GitHub.", "items": { "type": "string" }, "title": "Commits unverified", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "deployment-success": { "description": "The list of environments successfully deployed for the pull request. A deployment published by a GitHub App is also matched by its qualified `@/` form.", "items": { "type": "string" }, "title": "Deployment success", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "deployment-failure": { "description": "The list of environments whose deployment failed for the pull request. A deployment published by a GitHub App is also matched by its qualified `@/` form.", "items": { "type": "string" }, "title": "Deployment failure", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "review-threads-resolved": { "description": "The list of ids associated to review threads that are marked as resolved by GitHub.", "items": { "type": "string" }, "title": "Review threads resolved", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "review-threads-unresolved": { "description": "The list of ids associated to review threads that are NOT marked as resolved by GitHub.", "items": { "type": "string" }, "title": "Review threads unresolved", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "files": { "description": "The files that are modified, deleted or added by the pull request. A renamed file counts at both of its paths, so it appears twice; `#files` reports GitHub's own changed-file count, which counts it once.", "items": { "type": "string" }, "title": "Files", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "added-files": { "description": "The files that are added by the pull request, including the destination of a renamed file.", "items": { "type": "string" }, "title": "Added files", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "modified-files": { "description": "The files that are modified in place by the pull request. A renamed file is not modified: it is removed at its previous path and added at its new one.", "items": { "type": "string" }, "title": "Modified files", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "removed-files": { "description": "The files that are removed by the pull request, including the previous path of a renamed file.", "items": { "type": "string" }, "title": "Removed files", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "added-lines": { "description": "The lines that are added by the pull request. Only usable as `#added-lines` for the number of added lines.", "items": { "type": "string" }, "title": "Added lines", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "modified-lines": { "description": "The lines that are modified by the pull request. Only usable as `#modified-lines` for the number of modified lines.", "items": { "type": "string" }, "title": "Modified lines", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "deleted-lines": { "description": "The lines that are deleted by the pull request. Only usable as `#deleted-lines` for the number of deleted lines.", "items": { "type": "string" }, "title": "Deleted lines", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "co-authors": { "description": "The list of co-authors on the pull request (excluding merge commits and bots).", "items": { "$ref": "#/$defs/CommitAuthor" }, "title": "Co authors", "type": "array" }, "commits-behind": { "description": "The list of commits between the head of the base branch and the base of the pull request. This can only be used with the length operator as `#commits-behind`.", "items": { "type": "string" }, "title": "Commits behind", "type": "array", "x-allowed-operators": [ "=", "!=", ">=", "<=", "<", ">" ], "x-modifiers": [ { "type": "negate" }, { "required": true, "type": "length" } ] }, "depends-on": { "description": "The list of dependencies to other pull request in the format `owner/repo#prnumber`.", "items": { "type": "string" }, "title": "Depends on", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "dependabot-dependency-name": { "description": "The dependency-name value included in the Dependabot commit message.", "items": { "type": "string" }, "title": "Dependabot dependency name", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "dependabot-dependency-type": { "description": "The dependency-type value included in the Dependabot commit message.", "items": { "type": "string" }, "title": "Dependabot dependency type", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "dependabot-update-type": { "description": "The update-type value included in the Dependabot commit message.", "items": { "type": "string" }, "title": "Dependabot update type", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "scope": { "description": "The list of scopes associated with the pull request for merge queue batching. With a `files` source, a renamed file counts at both of its paths, so moving a file out of a scope reports that scope as well as the destination's.", "items": { "type": "string" }, "title": "Scope", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "commits": { "description": "The list of commits of the pull request. The index 0 is the first commit, while -1 is the last commit.", "items": { "$ref": "#/$defs/Commit" }, "title": "Commits", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "current-datetime": { "description": "The current date and time.", "format": "date-time", "title": "Current datetime", "type": "string", "x-allowed-operators": [ "=", "!=", ">=", "<=", "<", ">" ], "x-modifiers": [] }, "updated-at": { "description": "The time the pull request was updated at.", "format": "date-time", "title": "Updated at", "type": "string", "x-allowed-operators": [ ">=", "<=", "<", ">" ], "x-modifiers": [] }, "created-at": { "description": "The time the pull request was created at.", "format": "date-time", "title": "Created at", "type": "string", "x-allowed-operators": [ ">=", "<=", "<", ">" ], "x-modifiers": [] }, "closed-at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "description": "The time the pull request was closed at.", "title": "Closed at", "x-allowed-operators": [ ">=", "<=", "<", ">" ], "x-modifiers": [] }, "merged-at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "description": "The time the pull request was merged at.", "title": "Merged at", "x-allowed-operators": [ ">=", "<=", "<", ">" ], "x-modifiers": [] }, "queued-at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "description": "The time the pull request was queued at for merge.", "title": "Queued at", "x-allowed-operators": [ ">=", "<=", "<", ">" ], "x-modifiers": [] }, "queue-merge-started-at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "description": "The time the pull request mergeability checks have started at.", "title": "Queue merge started at", "x-allowed-operators": [ ">=", "<=", "<", ">" ], "x-modifiers": [] }, "schedule": { "description": "The current time will be compared against this schedule to validate this attribute.", "title": "Schedule", "type": "string", "x-allowed-operators": [ "=", "!=" ], "x-mergify-has-data-type": true, "x-modifiers": [] }, "sender-permission": { "$ref": "#/$defs/GitHubRepositoryPermission", "description": "The permission of the command author.", "title": "Sender permission", "x-allowed-operators": [ "=", "!=", ">=", "<=", "<", ">" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "sender": { "description": "The GitHub login of the command author.", "title": "Sender", "type": "string", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] }, "updates": { "description": "The list of updates done on an opened pull request.", "items": { "$ref": "#/$defs/PullRequestHeadShaHistoryDict" }, "title": "Updates", "type": "array", "x-allowed-operators": [ "=", "!=", "~=", ">=", "<=", "<", ">", "*=" ], "x-modifiers": [ { "type": "negate" }, { "type": "length" } ] } }, "required": [ "draft", "merged", "mergify-configuration-changed", "closed", "locked", "linear-history", "conflict", "github-review-decision", "github-require-review-from-specific-teams", "github-code-owner-review-satisfied", "github-review-approved", "github-require-last-push-approval", "number", "queue-position", "author", "merged-by", "merge-commit-sha", "milestone", "base", "head", "head-repo-full-name", "from-fork", "title", "body", "body-raw", "repository-name", "repository-full-name", "queue-dequeue-reason", "queue-name", "assignee", "label", "review-requested", "approved-reviews-by", "dismissed-reviews-by", "changes-requested-reviews-by", "commented-reviews-by", "check-success", "check-failure", "check-neutral", "check-timed-out", "check-skipped", "check-cancelled", "check-pending", "check", "check-stale", "commits-unverified", "deployment-success", "deployment-failure", "review-threads-resolved", "review-threads-unresolved", "files", "added-files", "modified-files", "removed-files", "added-lines", "modified-lines", "deleted-lines", "co-authors", "commits-behind", "depends-on", "dependabot-dependency-name", "dependabot-dependency-type", "dependabot-update-type", "scope", "commits", "current-datetime", "updated-at", "created-at", "closed-at", "merged-at", "queued-at", "queue-merge-started-at", "schedule", "sender-permission", "sender", "updates" ], "title": "PullRequestAttributes", "type": "object" }, "PullRequestHeadShaHistoryDict": { "properties": { "head-sha": { "title": "Head sha", "type": "string" }, "timestamp": { "title": "Timestamp", "type": "string" } }, "required": [ "head-sha", "timestamp" ], "title": "PullRequestHeadShaHistoryDict", "type": "object" }, "PullRequestRuleConditionsModel": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/NegationCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ] }, "maxItems": 500, "type": "array" }, { "const": true } ], "title": "List of conditions" }, "PullRequestRuleModel": { "additionalProperties": false, "properties": { "name": { "description": "The name of the rule. This is used when reporting information about a rule. It's not possible to have two rules with the same name.", "title": "Name", "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "A description of the rule.", "title": "Description" }, "disabled": { "anyOf": [ { "$ref": "#/$defs/DisabledDict" }, { "type": "null" } ], "default": null, "description": "If the rule is disabled, the reason why it's disabled." }, "conditions": { "$ref": "#/$defs/PullRequestRuleConditionsModel", "description": "The conditions that must be met for the rule to be evaluated." }, "actions": { "$ref": "#/$defs/ActionsModel", "description": "The actions to perform when the rule matches." } }, "required": [ "name", "conditions", "actions" ], "title": "Pull Request Rule", "type": "object" }, "PullRequestRulesModel": { "items": { "$ref": "#/$defs/PullRequestRuleModel" }, "maxItems": 200, "title": "PullRequestRulesModel", "type": "array" }, "QueueActionModel": { "additionalProperties": false, "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the queue rule where the pull request should be added. If no name is set, queue_conditions will be applied instead.", "title": "Name" } }, "title": "QueueActionModel", "type": "object" }, "QueueRuleMergeConditionsModel": { "anyOf": [ { "items": { "anyOf": [ { "$ref": "#/$defs/AndCondition" }, { "$ref": "#/$defs/OrCondition" }, { "$ref": "#/$defs/NegationCondition" }, { "$ref": "#/$defs/RuleConditionModel" } ] }, "maxItems": 500, "type": "array" }, { "const": true } ], "title": "List of conditions" }, "QueueRuleModel": { "additionalProperties": false, "properties": { "queue_conditions": { "$ref": "#/$defs/QueueRuleMergeConditionsModel", "description": "The list of conditions that needs to match to queue the pull request." }, "merge_conditions": { "$ref": "#/$defs/QueueRuleMergeConditionsModel", "description": "The list of conditions to match to get the queued pull request merged. In case of draft pull request, the merge conditions for checks are evaluated against the temporary pull request instead of the original one." }, "branch_protection_injection_mode": { "default": "queue", "description": "Branch protections conditions injection mode to use.\n\n- `queue` will inject branch protections conditions as required conditions for queuing and merging pull requests.\n- `merge` will inject branch protections conditions as required conditions only for merging pull requests.\n- `none` will not inject them at all, and requires a `merge_bot_account` able to satisfy the protections itself.", "enum": [ "queue", "merge", "none" ], "title": "Branch Protection Injection Mode", "type": "string" }, "batch_size": { "$ref": "#/$defs/BatchSizeBounds", "default": 1, "description": "The number of pull requests per speculative check in the queue. Either a single integer (fixed size, 1-128) or an object `{min, max}` for dynamic batching: the queue uses `min` when parallel-check slots are plentiful and grows toward `max` to keep the backlog at zero." }, "batch_max_wait_time": { "default": "30 seconds", "description": "The maximum amount of time to wait for additional pull requests before processing a batch that hasn't reached `batch_size`. The timer starts when the first pull request enters the batch. If `batch_size` is reached before this time expires, the batch processes immediately. This does not enforce a minimum delay between batches.", "format": "duration", "title": "Batch Max Wait Time", "type": "string" }, "allow_inplace_checks": { "default": true, "deprecated": true, "description": "Deprecated: this value is computed automatically. In-place checks are enabled only when:\n- `max_parallel_checks == 1`\n- every queue has `batch_size == 1`\n- every queue CI is single-step (no extra `merge_conditions`; either empty or identical to `queue_conditions`)", "title": "Allow Inplace Checks", "type": "boolean" }, "checks_timeout": { "anyOf": [ { "format": "duration", "type": "string" }, { "const": "auto", "type": "string" }, { "type": "null" } ], "default": "auto", "description": "The amount of time the merge queue waits for pending checks to return before dequeueing pull requests. This cannot be less than 60 seconds. Defaults to `auto`, which lets Mergify compute the timeout from the recent CI runtime of this queue (the 95th-percentile runtime with a safety margin). Runs identified as retry reruns or bisection runs are excluded from the calibration; runs whose provenance predates this tracking are kept for compatibility. `auto` applies no timeout until enough history has been gathered. Set to `null` to disable the checks timeout entirely.", "title": "Checks Timeout" }, "max_checks_retries": { "default": 0, "description": "Number of times Mergify will retry failed CI checks before removing the pull request from the queue. On each retry, the draft pull request is recreated to trigger a fresh CI run. This is useful for handling flaky CI. When set to a value greater than 0, in-place checks are disabled and a draft pull request is always created. Set to 0 (default) to disable retries.", "minimum": 0, "title": "Max Checks Retries", "type": "integer" }, "draft_bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to create its draft pull requests. If no `draft_bot_account` is set, Mergify creates the draft pull request itself. The user account must have already been logged in Mergify dashboard once and have admin, write or maintain permission.", "title": "Draft Bot Account" }, "queue_branch_merge_method": { "anyOf": [ { "const": "fast-forward", "type": "string" }, { "type": "null" } ], "default": null, "deprecated": true, "description": "Deprecated spelling of `merge_method: fast-forward`. If set to `fast-forward`, Mergify moves the base branch onto the draft pull request instead of merging the original pull request that has been checked, whatever `merge_method` is set to. Use `merge_method: fast-forward` instead.", "title": "Queue Branch Merge Method" }, "queue_branch_prefix": { "default": "mergify/merge-queue/", "description": "Prefix for the merge queue branch name. It must start valid git branch names, and cannot start with `refs/`, which GitHub refuses. Branches under this prefix are eligible for automatic [queue branch cleanup](https://docs.mergify.com/merge-queue/lifecycle#queue-branch-cleanup).", "title": "Queue Branch Prefix", "type": "string" }, "allow_queue_branch_edit": { "configuration_deprecated_attribute": { "deprecated_summary_ghes_mode": "`allow_queue_branch_edit` is deprecated and will be removed; remove it from your configuration. Once it is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is what Mergify does today for a queue that leaves it unset. Move the work now done on a batch branch onto the pull requests themselves. It is removed after 2026-12-31.", "deprecated_summary_saas_mode": "`allow_queue_branch_edit` is deprecated and will be removed; remove it from your configuration. Once it is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is what Mergify does today for a queue that leaves it unset. Move the work now done on a batch branch onto the pull requests themselves. It is removed after 2026-12-31." }, "default": false, "description": "Deprecated: this option is being removed after 2026-12-31, and there is no replacement. Move the work now done on a batch branch onto the pull requests themselves. Once the option is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is the behaviour you get today by leaving this unset.\n\nWhen creating a branch for a queue, if the commits of this branch are edited by an entity external to Mergify, Mergify dequeues all pull requests embarked in the branch and report the issue as a failure. If set to `true`, Mergify will allow such modifications and trust the content of the branch. Make sure only Mergify and your external application are allowed to edit these branches.\n\nThis option requires `merge_method` to be `merge-batch` or `fast-forward`. Those two merge the batch branch itself, so a commit pushed to it is part of what lands on the base branch; `merge`, `squash` and `rebase` merge each pull request at its own head, which never includes the edit.\n\nEnabling it therefore means the merged content is the batch branch, including commits that were never reviewed as part of any pull request. That is the contract of this option: it exists for batch-level work (a conflict resolution, a migration reorder, a lockfile regeneration) that belongs to no single pull request.\n\nNote also that under these two merge methods Mergify does not merge the pull requests one by one: GitHub marks each embarked pull request as merged only when its head commit is reachable from the new base branch tip, so a pull request whose head no longer matches what was embarked is not shown as merged even though its content landed.", "title": "Allow Queue Branch Edit", "type": "boolean" }, "conflict_resolvers": { "description": "Resolve conflicts on the files you name while Mergify builds a batch, instead of removing the pull request that conflicts from it. When several entries match a file, the last one wins.\n\nOnly takes effect when the batch branch Mergify built is what lands: `merge_method` set to `merge-batch` or `fast-forward`, or `queue_branch_merge_method` set to `fast-forward`. Otherwise `merge`, `squash` and `rebase` merge each pull request on its own, so a resolution made while building the batch would never land.", "items": { "$ref": "#/$defs/ConflictResolverModel" }, "title": "Conflict Resolvers", "type": "array" }, "batch_max_failure_resolution_attempts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The number of attempts to resolve a batch failure before dequeueing pull requests. By default, Mergify will attempt to resolve a batch failure by splitting the batch multiple times until it finds the root cause of the failure. You can stop this process earlier by limiting the number of resolution attempts. Setting this to 0 will dequeue all the pull requests from a batch when a batch fails.", "title": "Batch Max Failure Resolution Attempts" }, "merge_method": { "anyOf": [ { "enum": [ "merge", "rebase", "squash", "fast-forward", "merge-batch" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "Merge method to use. If no value is set, Mergify uses the first authorized method available in the repository configuration.\n\nAdditionally, `merge-batch` merges the draft pull request prepared by the merge queue using a merge commit. This requires `batch_size > 1`.", "title": "Merge Method" }, "autoqueue": { "default": false, "deprecated": true, "description": "When set to true, automatically add a pull request to the queue when it matches the queue conditions. When false, the pull request must be manually queued. Deprecated: use merge_protection_settings.auto_merge_conditions instead.", "title": "Autoqueue", "type": "boolean" }, "update_method": { "anyOf": [ { "enum": [ "rebase", "merge" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "Method to use to update the pull request with its base branch when the check is done in place.\nPossible values:\n\n- `merge` to merge the base branch into the pull request.\n- `rebase` to rebase the pull request against its base branch. When the queue\n runs its checks in place, a pull request coming from a fork cannot be rebased\n on behalf of an `update_bot_account` and is refused -- see that option for\n the remedy. Without an\n `update_bot_account`, the rebase goes through GitHub's API as Mergify, which\n works on a fork -- except for one that changes GitHub Actions workflows or\n was opened by another App's bot, which GitHub lets Mergify queue in place\n only *with* an `update_bot_account`, or one that changes more files than\n GitHub lists, which Mergify cannot rule out as a workflow change. Such a\n queue has to run its checks on a draft pull request instead.\n\nWhen `null`, defaults to `merge` except if `merge_method` is `fast-forward` then it defaults to `rebase`.", "title": "Update Method" }, "commit_message_template": { "anyOf": [ { "description": "A string template using the Jinja2 syntax.", "format": "template", "title": "Template", "type": "string" }, { "type": "null" } ], "configuration_deprecated_attribute": { "deprecated_summary_ghes_mode": "`commit_message_template` is deprecated and will be removed on 2026-09-30. Use the declarative `commit_message_format` instead: https://docs.mergify.com/workflow/actions/merge#migrating-from-commit_message_template", "deprecated_summary_saas_mode": "`commit_message_template` is deprecated and will be removed on 2026-09-30. Use the declarative `commit_message_format` instead: https://docs.mergify.com/workflow/actions/merge#migrating-from-commit_message_template" }, "default": null, "deprecated": true, "description": "Template to use as the commit message when using the merge or squash merge method. Deprecated: use `commit_message_format` instead.", "title": "Commit Message Template" }, "commit_message_format": { "anyOf": [ { "$ref": "#/$defs/CommitMessageFormatModel" }, { "type": "null" } ], "default": null, "description": "Declarative commit message format configuration. Use this instead of the Jinja2 `commit_message_template` for the common merge-commit shapes. Mutually exclusive with `commit_message_template` on the same rule." }, "merge_bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to merge pull requests. If no `merge_bot_account` is set, Mergify merges the pull request itself. The user account **must** have already been logged in Mergify dashboard once and have **write** or **maintain** permission.", "title": "Merge Bot Account" }, "update_bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "For certain actions, such as rebasing branches, Mergify has to impersonate a GitHub user. You can specify the account to use with this option. With no `update_bot_account`, the update goes through GitHub's API as Mergify and impersonates nobody. The user account **must** have already been logged in Mergify dashboard once. This option overrides the value defined in the queue rules section of the configuration.\n\n**Warning:** With `update_method: rebase` and checks run in place, a pull request coming from a fork cannot be rebased on behalf of this account: GitHub refuses an OAuth token on its rebase API for a fork, so it would mean impersonating the account to force-push the contributor's branch. Those pull requests are refused when they are queued. Unset this option to rebase them through GitHub's API as Mergify instead -- except for a fork pull request that changes GitHub Actions workflows or was opened by another App's bot, which GitHub lets Mergify queue in place only *with* an `update_bot_account`, or that changes more files than GitHub lists, which Mergify cannot rule out as a workflow change; such a queue has to run its checks on a draft pull request. Or set `update_method: merge` on a queue that does not merge with `fast-forward`: such a queue lands by moving the base branch onto this one, so a merge commit is what it exists to keep off it, and it has to run its checks on a draft pull request instead.", "title": "Update Bot Account" }, "name": { "description": "Name of the queue rule.", "title": "Name", "type": "string" } }, "required": [ "name" ], "title": "QueueRuleModel", "type": "object" }, "QueueRuleModelForDefaults": { "additionalProperties": false, "properties": { "queue_conditions": { "$ref": "#/$defs/QueueRuleMergeConditionsModel", "description": "The list of conditions that needs to match to queue the pull request." }, "merge_conditions": { "$ref": "#/$defs/QueueRuleMergeConditionsModel", "description": "The list of conditions to match to get the queued pull request merged. In case of draft pull request, the merge conditions for checks are evaluated against the temporary pull request instead of the original one." }, "branch_protection_injection_mode": { "default": "queue", "description": "Branch protections conditions injection mode to use.\n\n- `queue` will inject branch protections conditions as required conditions for queuing and merging pull requests.\n- `merge` will inject branch protections conditions as required conditions only for merging pull requests.\n- `none` will not inject them at all, and requires a `merge_bot_account` able to satisfy the protections itself.", "enum": [ "queue", "merge", "none" ], "title": "Branch Protection Injection Mode", "type": "string" }, "batch_size": { "$ref": "#/$defs/BatchSizeBounds", "default": 1, "description": "The number of pull requests per speculative check in the queue. Either a single integer (fixed size, 1-128) or an object `{min, max}` for dynamic batching: the queue uses `min` when parallel-check slots are plentiful and grows toward `max` to keep the backlog at zero." }, "batch_max_wait_time": { "default": "30 seconds", "description": "The maximum amount of time to wait for additional pull requests before processing a batch that hasn't reached `batch_size`. The timer starts when the first pull request enters the batch. If `batch_size` is reached before this time expires, the batch processes immediately. This does not enforce a minimum delay between batches.", "format": "duration", "title": "Batch Max Wait Time", "type": "string" }, "allow_inplace_checks": { "default": true, "deprecated": true, "description": "Deprecated: this value is computed automatically. In-place checks are enabled only when:\n- `max_parallel_checks == 1`\n- every queue has `batch_size == 1`\n- every queue CI is single-step (no extra `merge_conditions`; either empty or identical to `queue_conditions`)", "title": "Allow Inplace Checks", "type": "boolean" }, "checks_timeout": { "anyOf": [ { "format": "duration", "type": "string" }, { "const": "auto", "type": "string" }, { "type": "null" } ], "default": "auto", "description": "The amount of time the merge queue waits for pending checks to return before dequeueing pull requests. This cannot be less than 60 seconds. Defaults to `auto`, which lets Mergify compute the timeout from the recent CI runtime of this queue (the 95th-percentile runtime with a safety margin). Runs identified as retry reruns or bisection runs are excluded from the calibration; runs whose provenance predates this tracking are kept for compatibility. `auto` applies no timeout until enough history has been gathered. Set to `null` to disable the checks timeout entirely.", "title": "Checks Timeout" }, "max_checks_retries": { "default": 0, "description": "Number of times Mergify will retry failed CI checks before removing the pull request from the queue. On each retry, the draft pull request is recreated to trigger a fresh CI run. This is useful for handling flaky CI. When set to a value greater than 0, in-place checks are disabled and a draft pull request is always created. Set to 0 (default) to disable retries.", "minimum": 0, "title": "Max Checks Retries", "type": "integer" }, "draft_bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to create its draft pull requests. If no `draft_bot_account` is set, Mergify creates the draft pull request itself. The user account must have already been logged in Mergify dashboard once and have admin, write or maintain permission.", "title": "Draft Bot Account" }, "queue_branch_merge_method": { "anyOf": [ { "const": "fast-forward", "type": "string" }, { "type": "null" } ], "default": null, "deprecated": true, "description": "Deprecated spelling of `merge_method: fast-forward`. If set to `fast-forward`, Mergify moves the base branch onto the draft pull request instead of merging the original pull request that has been checked, whatever `merge_method` is set to. Use `merge_method: fast-forward` instead.", "title": "Queue Branch Merge Method" }, "queue_branch_prefix": { "default": "mergify/merge-queue/", "description": "Prefix for the merge queue branch name. It must start valid git branch names, and cannot start with `refs/`, which GitHub refuses. Branches under this prefix are eligible for automatic [queue branch cleanup](https://docs.mergify.com/merge-queue/lifecycle#queue-branch-cleanup).", "title": "Queue Branch Prefix", "type": "string" }, "allow_queue_branch_edit": { "configuration_deprecated_attribute": { "deprecated_summary_ghes_mode": "`allow_queue_branch_edit` is deprecated and will be removed; remove it from your configuration. Once it is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is what Mergify does today for a queue that leaves it unset. Move the work now done on a batch branch onto the pull requests themselves. It is removed after 2026-12-31.", "deprecated_summary_saas_mode": "`allow_queue_branch_edit` is deprecated and will be removed; remove it from your configuration. Once it is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is what Mergify does today for a queue that leaves it unset. Move the work now done on a batch branch onto the pull requests themselves. It is removed after 2026-12-31." }, "default": false, "description": "Deprecated: this option is being removed after 2026-12-31, and there is no replacement. Move the work now done on a batch branch onto the pull requests themselves. Once the option is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is the behaviour you get today by leaving this unset.\n\nWhen creating a branch for a queue, if the commits of this branch are edited by an entity external to Mergify, Mergify dequeues all pull requests embarked in the branch and report the issue as a failure. If set to `true`, Mergify will allow such modifications and trust the content of the branch. Make sure only Mergify and your external application are allowed to edit these branches.\n\nThis option requires `merge_method` to be `merge-batch` or `fast-forward`. Those two merge the batch branch itself, so a commit pushed to it is part of what lands on the base branch; `merge`, `squash` and `rebase` merge each pull request at its own head, which never includes the edit.\n\nEnabling it therefore means the merged content is the batch branch, including commits that were never reviewed as part of any pull request. That is the contract of this option: it exists for batch-level work (a conflict resolution, a migration reorder, a lockfile regeneration) that belongs to no single pull request.\n\nNote also that under these two merge methods Mergify does not merge the pull requests one by one: GitHub marks each embarked pull request as merged only when its head commit is reachable from the new base branch tip, so a pull request whose head no longer matches what was embarked is not shown as merged even though its content landed.", "title": "Allow Queue Branch Edit", "type": "boolean" }, "conflict_resolvers": { "description": "Resolve conflicts on the files you name while Mergify builds a batch, instead of removing the pull request that conflicts from it. When several entries match a file, the last one wins.\n\nOnly takes effect when the batch branch Mergify built is what lands: `merge_method` set to `merge-batch` or `fast-forward`, or `queue_branch_merge_method` set to `fast-forward`. Otherwise `merge`, `squash` and `rebase` merge each pull request on its own, so a resolution made while building the batch would never land.", "items": { "$ref": "#/$defs/ConflictResolverModel" }, "title": "Conflict Resolvers", "type": "array" }, "batch_max_failure_resolution_attempts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The number of attempts to resolve a batch failure before dequeueing pull requests. By default, Mergify will attempt to resolve a batch failure by splitting the batch multiple times until it finds the root cause of the failure. You can stop this process earlier by limiting the number of resolution attempts. Setting this to 0 will dequeue all the pull requests from a batch when a batch fails.", "title": "Batch Max Failure Resolution Attempts" }, "merge_method": { "anyOf": [ { "enum": [ "merge", "rebase", "squash", "fast-forward", "merge-batch" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "Merge method to use. If no value is set, Mergify uses the first authorized method available in the repository configuration.\n\nAdditionally, `merge-batch` merges the draft pull request prepared by the merge queue using a merge commit. This requires `batch_size > 1`.", "title": "Merge Method" }, "autoqueue": { "default": false, "deprecated": true, "description": "When set to true, automatically add a pull request to the queue when it matches the queue conditions. When false, the pull request must be manually queued. Deprecated: use merge_protection_settings.auto_merge_conditions instead.", "title": "Autoqueue", "type": "boolean" }, "update_method": { "anyOf": [ { "enum": [ "rebase", "merge" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "Method to use to update the pull request with its base branch when the check is done in place.\nPossible values:\n\n- `merge` to merge the base branch into the pull request.\n- `rebase` to rebase the pull request against its base branch. When the queue\n runs its checks in place, a pull request coming from a fork cannot be rebased\n on behalf of an `update_bot_account` and is refused -- see that option for\n the remedy. Without an\n `update_bot_account`, the rebase goes through GitHub's API as Mergify, which\n works on a fork -- except for one that changes GitHub Actions workflows or\n was opened by another App's bot, which GitHub lets Mergify queue in place\n only *with* an `update_bot_account`, or one that changes more files than\n GitHub lists, which Mergify cannot rule out as a workflow change. Such a\n queue has to run its checks on a draft pull request instead.\n\nWhen `null`, defaults to `merge` except if `merge_method` is `fast-forward` then it defaults to `rebase`.", "title": "Update Method" }, "commit_message_template": { "anyOf": [ { "description": "A string template using the Jinja2 syntax.", "format": "template", "title": "Template", "type": "string" }, { "type": "null" } ], "configuration_deprecated_attribute": { "deprecated_summary_ghes_mode": "`commit_message_template` is deprecated and will be removed on 2026-09-30. Use the declarative `commit_message_format` instead: https://docs.mergify.com/workflow/actions/merge#migrating-from-commit_message_template", "deprecated_summary_saas_mode": "`commit_message_template` is deprecated and will be removed on 2026-09-30. Use the declarative `commit_message_format` instead: https://docs.mergify.com/workflow/actions/merge#migrating-from-commit_message_template" }, "default": null, "deprecated": true, "description": "Template to use as the commit message when using the merge or squash merge method. Deprecated: use `commit_message_format` instead.", "title": "Commit Message Template" }, "commit_message_format": { "anyOf": [ { "$ref": "#/$defs/CommitMessageFormatModel" }, { "type": "null" } ], "default": null, "description": "Declarative commit message format configuration. Use this instead of the Jinja2 `commit_message_template` for the common merge-commit shapes. Mutually exclusive with `commit_message_template` on the same rule." }, "merge_bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to merge pull requests. If no `merge_bot_account` is set, Mergify merges the pull request itself. The user account **must** have already been logged in Mergify dashboard once and have **write** or **maintain** permission.", "title": "Merge Bot Account" }, "update_bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "For certain actions, such as rebasing branches, Mergify has to impersonate a GitHub user. You can specify the account to use with this option. With no `update_bot_account`, the update goes through GitHub's API as Mergify and impersonates nobody. The user account **must** have already been logged in Mergify dashboard once. This option overrides the value defined in the queue rules section of the configuration.\n\n**Warning:** With `update_method: rebase` and checks run in place, a pull request coming from a fork cannot be rebased on behalf of this account: GitHub refuses an OAuth token on its rebase API for a fork, so it would mean impersonating the account to force-push the contributor's branch. Those pull requests are refused when they are queued. Unset this option to rebase them through GitHub's API as Mergify instead -- except for a fork pull request that changes GitHub Actions workflows or was opened by another App's bot, which GitHub lets Mergify queue in place only *with* an `update_bot_account`, or that changes more files than GitHub lists, which Mergify cannot rule out as a workflow change; such a queue has to run its checks on a draft pull request. Or set `update_method: merge` on a queue that does not merge with `fast-forward`: such a queue lands by moving the base branch onto this one, so a merge commit is what it exists to keep off it, and it has to run its checks on a draft pull request instead.", "title": "Update Bot Account" } }, "title": "QueueRuleModelForDefaults", "type": "object" }, "QueueRulesModel": { "items": { "$ref": "#/$defs/QueueRuleModel" }, "maxItems": 50, "title": "QueueRulesModel", "type": "array" }, "RebaseActionModel": { "additionalProperties": false, "properties": { "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "To rebase, Mergify needs to impersonate a GitHub user. You can specify the account to use with this option. If no `bot_account` is set, Mergify picks the pull request author, or the user who sent the `@mergifyio rebase` command. The user account must have already been logged in Mergify dashboard once.\n\n**Warning:** Because of GitHub's security restrictions, Mergify cannot impersonate an account owned by another GitHub App. A rebase therefore fails whenever the account it falls back to is a bot, either because the pull request was opened by one or because one sent the command, unless `bot_account` names a user account.\n\n**Warning:** A pull request coming from a fork cannot be rebased, whether or not this option is set: rebasing one means impersonating a GitHub user to force-push the contributor's branch. Use the `update` action or the `@mergifyio update` command on those -- except where Mergify cannot write the head branch at all, such as a deleted fork, where `update` is refused too and the check run says what is wrong.", "title": "Bot Account" } }, "title": "RebaseActionModel", "type": "object" }, "ReportMode": { "enum": [ "check", "comment" ], "title": "Report Mode", "type": "string", "x-mergify-has-data-type": true }, "RequestReviewsActionModel": { "additionalProperties": false, "properties": { "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to request a review on a pull request. If no `bot_account` is set, Mergify will request the review itself.", "title": "Bot Account" }, "random_count": { "anyOf": [ { "maximum": 15, "minimum": 1, "type": "integer" }, { "type": "null" } ], "default": null, "description": "Pick random users and teams from the provided lists. When `random_count` is specified, `users` and `teams` can be a dictionary where the key is the login and the value is the weight to use. Weight must be between 1 and 65535 included.", "title": "Random Count" }, "users": { "anyOf": [ { "items": { "type": "string" }, "maxItems": 150, "type": "array" }, { "additionalProperties": { "maximum": 65535, "minimum": 1, "type": "integer" }, "type": "object" } ], "description": "The usernames to request reviews from.", "title": "Users" }, "teams": { "anyOf": [ { "items": { "type": "string" }, "maxItems": 150, "type": "array" }, { "additionalProperties": { "maximum": 65535, "minimum": 1, "type": "integer" }, "type": "object" } ], "description": "The team names to request reviews from.", "title": "Teams" }, "users_from_teams": { "anyOf": [ { "items": { "type": "string" }, "maxItems": 150, "type": "array" }, { "additionalProperties": { "maximum": 65535, "minimum": 1, "type": "integer" }, "type": "object" } ], "description": "The team names to get the list of users to request reviews from.", "title": "Users From Teams" } }, "title": "RequestReviewsActionModel", "type": "object" }, "ReviewActionModel": { "additionalProperties": false, "properties": { "type": { "default": "APPROVE", "description": "The type of review to post", "enum": [ "APPROVE", "REQUEST_CHANGES", "COMMENT" ], "title": "Type", "type": "string" }, "message": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `approvers`, `assignees`, `author`, `base`, `body`, `head`, `labels`, `number`, `queue_dequeue_reason`, `title`.", "format": "simple-template", "title": "Message template", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" }, { "description": "The pull request number.", "name": "number" }, { "description": "The pull request title.", "name": "title" }, { "description": "The pull request description (body).", "name": "body" }, { "description": "The base branch name.", "name": "base" }, { "description": "The head branch name.", "name": "head" }, { "description": "The pull request's labels as a comma-separated list (e.g. `bug, feat`); empty when none.", "name": "labels" }, { "description": "Assignees as a ready-to-use @mention list (e.g. `@alice, @bob`); empty when none.", "name": "assignees" }, { "description": "Reviewers who approved, as a @mention list (e.g. `@alice, @bob`); empty when none.", "name": "approvers" }, { "description": "Why the pull request left the merge queue; empty outside queue contexts.", "name": "queue_dequeue_reason" } ] }, { "type": "null" } ], "default": null, "description": "The message to post in the review", "title": "Message" }, "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to review a pull request. If no `bot_account` is set, Mergify will review the pull request itself.", "title": "Bot Account" } }, "title": "ReviewActionModel", "type": "object" }, "RuleConditionModel": { "description": "Model defining a single rule condition 'leaf of a condition tree'", "title": "RuleConditionModel", "type": "string" }, "Scopes": { "additionalProperties": false, "else": { "properties": { "capacities": { "propertyNames": { "anyOf": [ { "minLength": 2, "pattern": "^[A-Za-z0-9_-]+$", "type": "string" }, { "pattern": "[\\*\\?\\[\\{]" } ] } } } }, "if": { "properties": { "source": { "required": [ "manual" ], "type": "object" } }, "required": [ "source" ] }, "properties": { "source": { "anyOf": [ { "$ref": "#/$defs/SourceFiles" }, { "$ref": "#/$defs/SourceManual" }, { "type": "null" } ], "default": null, "description": "Where scopes come from. `files` derives scopes from the pull request's changed files using file-pattern rules; `manual` uses scopes sent via API or `mergify scopes-send`; `None` disables scoping.", "title": "Source" }, "barrier_files": { "anyOf": [ { "$ref": "#/$defs/BarrierFileFilters" }, { "type": "null" } ], "default": null, "description": "File filters marking files that impact every scope. Only valid with a `files` source; a `manual` source reports the barrier flag via the API instead. A pull request changing a matching file becomes a merge-queue barrier: it runs alone and serializes the queue at that point. A renamed file counts at both of its paths, so moving a file out of a matching pattern is a barrier too. At least one `include` pattern is required. Examples: ('.github/workflows/**', 'Makefile')" }, "merge_queue_scope": { "default": "merge-queue", "description": "Scope name automatically applied to merge queue PRs.", "minLength": 2, "pattern": "^[A-Za-z0-9_-]+$", "title": "Merge Queue Scope", "type": "string" }, "capacities": { "additionalProperties": { "maximum": 128, "minimum": 1, "type": "integer" }, "description": "How many speculative checks each scope may run at the same time, as a map of scope name to capacity. Works for any `source` (file globs or the manual scopes API just decide membership; capacity is declared here). With a `manual` source a key may be any scope name the scopes API accepts, such as `//lib/core` or `@acme/web`; with any other source a key that is not a pattern must be a valid scope name. A key containing `*`, `?`, `[` or `{` is a glob pattern with the syntax of `files` filters, such as `@acme/*` or `//lib/**`: `*` and `?` stay within one `/`-separated segment and only a whole `**` segment crosses them, so `//lib/**` matches the packages below `//lib` but not `//lib` itself. In YAML, quote any key starting with `@`, `*`, `?`, `[` or `{`. A pattern gives every scope it matches its own budget, not one budget shared by all of them. A key equal to a scope's name wins over any pattern; when several patterns match a scope, the smallest capacity applies; `default_capacity` only covers scopes no key matches. A PR in several capped scopes consumes one slot from each. PRs whose scopes match no key share the repo-wide `merge_queue.max_parallel_checks` pool, unless `default_capacity` gives every scope a budget. Strict branch protection still forces an effective capacity of 1.", "propertyNames": { "maxLength": 1024 }, "title": "Capacities", "type": "object" }, "default_capacity": { "anyOf": [ { "maximum": 128, "minimum": 1, "type": "integer" }, { "type": "null" } ], "default": null, "description": "How many speculative checks a scope that no `capacities` key matches may run at the same time. Applies to every scope observed on queued pull requests, so dynamic scope sets (e.g. sent by a monorepo build tool through the manual scopes API) get a per-scope budget without enumerating names; a matching `capacities` key or pattern still wins for its scope. `merge_queue.max_parallel_checks` remains the global ceiling on the total. When unset, scopes no `capacities` key matches are unlimited, and pull requests with no scopes always draw from the repo-wide pool. Strict branch protection still forces an effective capacity of 1.", "title": "Default Capacity" } }, "title": "Scopes", "type": "object" }, "SourceFiles": { "additionalProperties": false, "properties": { "files": { "description": "Mapping of scope name to its file filters. A file belongs to a scope if it matches the scope's `include` patterns and not its `exclude` patterns.", "patternProperties": { "^[A-Za-z0-9_-]+$": { "$ref": "#/$defs/FileFilters" } }, "propertyNames": { "minLength": 2 }, "title": "Files", "type": "object" } }, "required": [ "files" ], "title": "SourceFiles", "type": "object" }, "SourceManual": { "additionalProperties": false, "properties": { "manual": { "description": "Scopes are manually sent via API or `mergify scopes-send`", "title": "Manual", "type": "null" } }, "required": [ "manual" ], "title": "SourceManual", "type": "object" }, "SquashActionModel": { "additionalProperties": false, "properties": { "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to squash a pull request. If no `bot_account` is set, Mergify picks the pull request author, or the user who sent the `@mergifyio squash` command. The user account must have already been logged in Mergify dashboard once.\n\n**Warning:** Because of GitHub's security restrictions, Mergify cannot impersonate an account owned by another GitHub App. A squash therefore fails whenever the account it falls back to is a bot, either because the pull request was opened by one or because one sent the command, unless `bot_account` names a user account.", "title": "Bot Account" }, "commit_message": { "default": "all-commits", "description": "Defines the default commit message to use for the squashed commit.\nPossible values are:\n\n- `all-commits` to use the same format as GitHub squashed merge commit.\n- `first-commit` to use the message of the first commit of the pull request.\n- `title+body` means to use the title and body from the pull request itself as the commit message. The pull request number will be added to end of the title.", "enum": [ "all-commits", "first-commit", "title+body" ], "title": "Commit Message", "type": "string" } }, "title": "SquashActionModel", "type": "object" }, "UpdateActionModel": { "additionalProperties": false, "properties": { "bot_account": { "anyOf": [ { "description": "A string with `{{ variable }}` placeholders. Allowed variables: `author`.", "format": "simple-template", "title": "Bot account", "type": "string", "x-mergify-template-variables": [ { "description": "The pull request author's login.", "name": "author" } ] }, { "type": "null" } ], "default": null, "description": "Mergify can impersonate a GitHub user to update a pull request. If no `bot_account` is set, Mergify will update the pull request itself.", "title": "Bot Account" } }, "title": "UpdateActionModel", "type": "object" } }, "title": "MergifyConfigModel", "type": "object", "properties": { "shared": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Shared" }, "extends": { "anyOf": [ { "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "title": "Extends" }, "defaults": { "$ref": "#/$defs/DefaultsRulesModel" }, "scopes": { "$ref": "#/$defs/Scopes" }, "commands_restrictions": { "$ref": "#/$defs/CommandsRestrictionsRulesModel" }, "pull_request_rules": { "$ref": "#/$defs/PullRequestRulesModel" }, "queue_rules": { "$ref": "#/$defs/QueueRulesModel" }, "merge_protections": { "$ref": "#/$defs/MergeProtectionRulesModel" }, "priority_rules": { "$ref": "#/$defs/PriorityRulesModel" }, "merge_queue": { "$ref": "#/$defs/MergeQueue" }, "merge_protections_settings": { "$ref": "#/$defs/MergeProtections" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false } ``` --- # Mergify Changelog Mergify ChangelogLatest product updates from Mergifyhttps://docs.mergify.com/en-usMon, 05 Oct 2026 18:34:50 GMThttps://docs.mergify.com/changeloghello@mergify.com (Mergify)https://docs.mergify.com/favicon.svgMergify Changeloghttps://docs.mergify.com/changelogFix quarantined tests with AIhttps://docs.mergify.com/changelog/2026-10-05-fix-quarantined-tests-with-ai/https://docs.mergify.com/changelog/2026-10-05-fix-quarantined-tests-with-ai/Hand a quarantined test to Claude Code or Cursor with a ready-made prompt to fix it.Mon, 05 Oct 2026 00:00:00 GMTHand a quarantined test to Claude Code or Cursor with a ready-made prompt to fix it.Test Insightshello@mergify.com (Mergify)See how many CI runs each merged pull request costshttps://docs.mergify.com/changelog/2026-10-05-see-how-many-ci-runs-each-merged-pull-request-costs/https://docs.mergify.com/changelog/2026-10-05-see-how-many-ci-runs-each-merged-pull-request-costs/The Merge Queue Stats page now shows how many CI runs the queue starts for each pull request it merges, and why the runs that led to no merge were thrown away.Mon, 05 Oct 2026 00:00:00 GMTThe Merge Queue Stats page now shows how many CI runs the queue starts for each pull request it merges, and why the runs that led to no merge were thrown away.Merge Queuehello@mergify.com (Mergify)\`autosquash\` has been removedhttps://docs.mergify.com/changelog/2026-09-29-autosquash-has-been-removed/https://docs.mergify.com/changelog/2026-09-29-autosquash-has-been-removed/Configurations that still set \`autosquash\` no longer validate.Tue, 29 Sep 2026 00:00:00 GMTConfigurations that still set \`autosquash\` no longer validate.Deprecationshello@mergify.com (Mergify)Filter quarantined tests by health on Mitigationhttps://docs.mergify.com/changelog/2026-09-29-filter-quarantined-tests-by-health-on-mitigation/https://docs.mergify.com/changelog/2026-09-29-filter-quarantined-tests-by-health-on-mitigation/Test Insights › Mitigation: filter the quarantined tests by health — find the ones that have recovered and release them from quarantine in one action.Tue, 29 Sep 2026 00:00:00 GMTTest Insights › Mitigation: filter the quarantined tests by health — find the ones that have recovered and release them from quarantine in one action.Test Insightshello@mergify.com (Mergify)Know when a queued pull request merged without landing anythinghttps://docs.mergify.com/changelog/2026-09-29-know-when-a-queued-pull-request-merged-without-landing-anything/https://docs.mergify.com/changelog/2026-09-29-know-when-a-queued-pull-request-merged-without-landing-anything/The merge queue now flags a pull request that merged without changing the base branch, instead of leaving it looking like it shipped.Tue, 29 Sep 2026 00:00:00 GMTThe merge queue now flags a pull request that merged without changing the base branch, instead of leaving it looking like it shipped.Merge Queuehello@mergify.com (Mergify)Pull requests from a fork can no longer be rebasedhttps://docs.mergify.com/changelog/2026-09-29-pull-requests-from-a-fork-can-no-longer-be-rebased/https://docs.mergify.com/changelog/2026-09-29-pull-requests-from-a-fork-can-no-longer-be-rebased/The rebase action and the @mergifyio rebase command now fail on a pull request that comes from a fork. Use update instead.Tue, 29 Sep 2026 00:00:00 GMTThe rebase action and the @mergifyio rebase command now fail on a pull request that comes from a fork. Use update instead.Workflow AutomationDeprecationshello@mergify.com (Mergify)Remove several tests from quarantine at once, from the Mitigation pagehttps://docs.mergify.com/changelog/2026-09-29-remove-several-tests-from-quarantine-at-once-from-the-mitigation-page/https://docs.mergify.com/changelog/2026-09-29-remove-several-tests-from-quarantine-at-once-from-the-mitigation-page/Test Insights › Mitigation: select several quarantined tests and remove them from quarantine in one action, directly from the list of quarantined tests.Tue, 29 Sep 2026 00:00:00 GMTTest Insights › Mitigation: select several quarantined tests and remove them from quarantine in one action, directly from the list of quarantined tests.Test Insightshello@mergify.com (Mergify)The merge queue no longer rebases fork pull requests on behalf of an accounthttps://docs.mergify.com/changelog/2026-09-29-the-merge-queue-no-longer-rebases-fork-pull-requests-on-behalf-of-an-account/https://docs.mergify.com/changelog/2026-09-29-the-merge-queue-no-longer-rebases-fork-pull-requests-on-behalf-of-an-account/A queue rule that pairs update\_method: rebase with update\_bot\_account now refuses pull requests that come from a fork.Tue, 29 Sep 2026 00:00:00 GMTA queue rule that pairs update\_method: rebase with update\_bot\_account now refuses pull requests that come from a fork.Merge QueueDeprecationshello@mergify.com (Mergify)\`allow\_queue\_branch\_edit\` is deprecatedhttps://docs.mergify.com/changelog/2026-09-23-allow-queue-branch-edit-is-deprecated/https://docs.mergify.com/changelog/2026-09-23-allow-queue-branch-edit-is-deprecated/The \`allow\_queue\_branch\_edit\` queue rule option is deprecated and will be removed after December 31, 2026.Wed, 23 Sep 2026 00:00:00 GMTThe \`allow\_queue\_branch\_edit\` queue rule option is deprecated and will be removed after December 31, 2026.Merge Queuehello@mergify.com (Mergify)Jinja2 templating stops working on October 31, 2026https://docs.mergify.com/changelog/2026-09-23-jinja2-templating-stops-working-on-october-31-2026/https://docs.mergify.com/changelog/2026-09-23-jinja2-templating-stops-working-on-october-31-2026/Jinja2 expressions in your Mergify configuration stop working on October 31, 2026; plain {{ variable }} placeholders keep working.Wed, 23 Sep 2026 00:00:00 GMTJinja2 expressions in your Mergify configuration stop working on October 31, 2026; plain {{ variable }} placeholders keep working.DeprecationsRuleshello@mergify.com (Mergify)Pick a condition's scope from the repository's scopeshttps://docs.mergify.com/changelog/2026-09-23-pick-a-conditions-scope-from-the-repositorys-scopes/https://docs.mergify.com/changelog/2026-09-23-pick-a-conditions-scope-from-the-repositorys-scopes/In the dashboard's condition editor, a condition on scope now offers the scopes declared in the repository's configuration instead of a free text field; a scope that is not declared stays editable and is discreetly marked.Wed, 23 Sep 2026 00:00:00 GMTIn the dashboard's condition editor, a condition on scope now offers the scopes declared in the repository's configuration instead of a free text field; a scope that is not declared stays editable and is discreetly marked.Merge QueueMerge Protectionshello@mergify.com (Mergify)The configuration editor tells you which sections your enabled products will never readhttps://docs.mergify.com/changelog/2026-09-23-the-configuration-editor-tells-you-which-sections-your-enabled-products-will-never-read/https://docs.mergify.com/changelog/2026-09-23-the-configuration-editor-tells-you-which-sections-your-enabled-products-will-never-read/The Summary panel of the configuration editor, the Configuration changed check on a configuration pull request, and mergify config simulate now warn when a section of .mergify.yml (pull\_request\_rules, merge\_protections, queue\_rules) is never evaluated because the product that runs it is not activated on the repository — with a link to activate it.Wed, 23 Sep 2026 00:00:00 GMTThe Summary panel of the configuration editor, the Configuration changed check on a configuration pull request, and mergify config simulate now warn when a section of .mergify.yml (pull\_request\_rules, merge\_protections, queue\_rules) is never evaluated because the product that runs it is not activated on the repository — with a link to activate it.Workflow AutomationMerge ProtectionsMerge Queuehello@mergify.com (Mergify)Datadog integration: four merge queue metrics are being retiredhttps://docs.mergify.com/changelog/2026-09-08-datadog-integration-four-merge-queue-metrics-are-being-retired/https://docs.mergify.com/changelog/2026-09-08-datadog-integration-four-merge-queue-metrics-are-being-retired/The operational Datadog metrics are retired in favour of the mergify.queue.\* set shipped in July. Two have a renamed counterpart, two have none.Tue, 08 Sep 2026 00:00:00 GMTThe operational Datadog metrics are retired in favour of the mergify.queue.\* set shipped in July. Two have a renamed counterpart, two have none.DeprecationsIntegrationshello@mergify.com (Mergify)Head branch updates stay inside your repository and its forkshttps://docs.mergify.com/changelog/2026-09-08-head-branch-updates-stay-inside-your-repository-and-its-forks/https://docs.mergify.com/changelog/2026-09-08-head-branch-updates-stay-inside-your-repository-and-its-forks/The update, rebase and squash actions now refuse to write a head branch that lives in a repository yours was forked from.Tue, 08 Sep 2026 00:00:00 GMTThe update, rebase and squash actions now refuse to write a head branch that lives in a repository yours was forked from.Workflow Automationhello@mergify.com (Mergify)Pin a deployment condition to the app that deployedhttps://docs.mergify.com/changelog/2026-09-04-pin-a-deployment-condition-to-the-app-that-deployed/https://docs.mergify.com/changelog/2026-09-04-pin-a-deployment-condition-to-the-app-that-deployed/\`deployment-success\` and \`deployment-failure\` now accept the qualified \`@/\` form, so a rule can require an environment be deployed by one specific app.Fri, 04 Sep 2026 00:00:00 GMT\`deployment-success\` and \`deployment-failure\` now accept the qualified \`@/\` form, so a rule can require an environment be deployed by one specific app.Ruleshello@mergify.com (Mergify)Clearer reason when the merge queue can't create the draft pull requesthttps://docs.mergify.com/changelog/2026-08-25-clearer-reason-when-the-merge-queue-cant-create-the-draft-pull-request/https://docs.mergify.com/changelog/2026-08-25-clearer-reason-when-the-merge-queue-cant-create-the-draft-pull-request/The dequeue reason now carries GitHub's own refusal message, including the repository rule that blocked the push.Tue, 25 Aug 2026 00:00:00 GMTThe dequeue reason now carries GitHub's own refusal message, including the repository rule that blocked the push.Merge Queuehello@mergify.com (Mergify)Pagination drops the first and last linkshttps://docs.mergify.com/changelog/2026-08-25-pagination-drops-the-first-and-last-links/https://docs.mergify.com/changelog/2026-08-25-pagination-drops-the-first-and-last-links/Paginated API responses now advertise only next and prev, and omit the Link header entirely when a page has neither.Tue, 25 Aug 2026 00:00:00 GMTPaginated API responses now advertise only next and prev, and omit the Link header entirely when a page has neither.APIhello@mergify.com (Mergify)Per-lane check capacity for dynamic scopeshttps://docs.mergify.com/changelog/2026-08-25-per-lane-check-capacity-for-dynamic-scopes/https://docs.mergify.com/changelog/2026-08-25-per-lane-check-capacity-for-dynamic-scopes/Set a single speculative-check budget that applies to every scope, so dynamic scope sets get per-lane capacity without listing scope names.Tue, 25 Aug 2026 00:00:00 GMTSet a single speculative-check budget that applies to every scope, so dynamic scope sets get per-lane capacity without listing scope names.Merge Queuehello@mergify.com (Mergify)Repository badge API removedhttps://docs.mergify.com/changelog/2026-08-25-repository-badge-api-removed/https://docs.mergify.com/changelog/2026-08-25-repository-badge-api-removed/The deprecated /v1/badges/\* endpoints are gone; a Mergify badge embedded in a README no longer renders.Tue, 25 Aug 2026 00:00:00 GMTThe deprecated /v1/badges/\* endpoints are gone; a Mergify badge embedded in a README no longer renders.APIhello@mergify.com (Mergify)Merge GitHub stacked pull requests with the merge queuehttps://docs.mergify.com/changelog/2026-08-12-merge-github-stacked-pull-requests-with-the-merge-queue/https://docs.mergify.com/changelog/2026-08-12-merge-github-stacked-pull-requests-with-the-merge-queue/Queue any member of a GitHub-native stacked pull request and Mergify merges it, in order, through GitHub's merge API.Wed, 12 Aug 2026 00:00:00 GMTQueue any member of a GitHub-native stacked pull request and Mergify merges it, in order, through GitHub's merge API.Merge Queuehello@mergify.com (Mergify)Author-run commands now require a fork pull requesthttps://docs.mergify.com/changelog/2026-08-11-author-run-commands-now-require-a-fork-pull-request/https://docs.mergify.com/changelog/2026-08-11-author-run-commands-now-require-a-fork-pull-request/The default restrictions for update, rebase, squash and refresh now let the pull request author run them only on pull requests coming from a fork.Tue, 11 Aug 2026 00:00:00 GMTThe default restrictions for update, rebase, squash and refresh now let the pull request author run them only on pull requests coming from a fork.Ruleshello@mergify.com (Mergify)New from-fork condition attributehttps://docs.mergify.com/changelog/2026-08-11-new-from-fork-condition-attribute/https://docs.mergify.com/changelog/2026-08-11-new-from-fork-condition-attribute/Conditions can now match on whether a pull request comes from a fork.Tue, 11 Aug 2026 00:00:00 GMTConditions can now match on whether a pull request comes from a fork.Ruleshello@mergify.com (Mergify)Label pull requests while the merge queue checks themhttps://docs.mergify.com/changelog/2026-07-29-label-pull-requests-while-the-merge-queue-checks-them/https://docs.mergify.com/changelog/2026-07-29-label-pull-requests-while-the-merge-queue-checks-them/A new \`checking\_label\` option labels a pull request for the whole time the merge queue is checking it.Wed, 29 Jul 2026 00:00:00 GMTA new \`checking\_label\` option labels a pull request for the whole time the merge queue is checking it.Merge Queuehello@mergify.com (Mergify)The github\_actions action is deprecatedhttps://docs.mergify.com/changelog/2026-07-29-the-github-actions-action-is-deprecated/https://docs.mergify.com/changelog/2026-07-29-the-github-actions-action-is-deprecated/The github\_actions workflow automation action is deprecated and will be removed on 31 March 2027. Trigger your workflows from GitHub Actions directly with on: pull\_request, workflow\_dispatch, or repository\_dispatch instead.Wed, 29 Jul 2026 00:00:00 GMTThe github\_actions workflow automation action is deprecated and will be removed on 31 March 2027. Trigger your workflows from GitHub Actions directly with on: pull\_request, workflow\_dispatch, or repository\_dispatch instead.Workflow AutomationDeprecationshello@mergify.com (Mergify)Automatic flaky test detection and preventionhttps://docs.mergify.com/changelog/2026-07-24-automatic-flaky-test-detection-and-prevention/https://docs.mergify.com/changelog/2026-07-24-automatic-flaky-test-detection-and-prevention/Mergify's test framework plugins now automatically rerun your tests to catch new flaky tests before they merge and surface existing flaky or broken tests on your default branch — all within a CI budget you control.Fri, 24 Jul 2026 00:00:00 GMTMergify's test framework plugins now automatically rerun your tests to catch new flaky tests before they merge and surface existing flaky or broken tests on your default branch — all within a CI budget you control.Test Insightshello@mergify.com (Mergify)Automatic self-hosted runner trackinghttps://docs.mergify.com/changelog/2026-07-24-automatic-self-hosted-runner-tracking/https://docs.mergify.com/changelog/2026-07-24-automatic-self-hosted-runner-tracking/Self-hosted runner and queue metrics now populate automatically, with no configuration required.Fri, 24 Jul 2026 00:00:00 GMTSelf-hosted runner and queue metrics now populate automatically, with no configuration required.CI Insightshello@mergify.com (Mergify)Avg, P95, and Max in the Merge Queue Time Breakdownhttps://docs.mergify.com/changelog/2026-07-24-avg-p95-and-max-in-the-merge-queue-time-breakdown/https://docs.mergify.com/changelog/2026-07-24-avg-p95-and-max-in-the-merge-queue-time-breakdown/The Merge Queue Stats page's Time Breakdown now lets you switch each queued-time component between average, 95th percentile, and max.Fri, 24 Jul 2026 00:00:00 GMTThe Merge Queue Stats page's Time Breakdown now lets you switch each queued-time component between average, 95th percentile, and max.Merge Queuehello@mergify.com (Mergify)New "Batches Saved" merge queue statistichttps://docs.mergify.com/changelog/2026-07-24-new-batches-saved-merge-queue-statistic/https://docs.mergify.com/changelog/2026-07-24-new-batches-saved-merge-queue-statistic/The merge queue Statistics page now shows how many CI runs skip\_intermediate\_results saved — the number of batches merged without running their own speculative CI.Fri, 24 Jul 2026 00:00:00 GMTThe merge queue Statistics page now shows how many CI runs skip\_intermediate\_results saved — the number of batches merged without running their own speculative CI.Merge Queuehello@mergify.com (Mergify)See what a queued pull request is waiting onhttps://docs.mergify.com/changelog/2026-07-24-see-what-a-queued-pull-request-is-waiting-on/https://docs.mergify.com/changelog/2026-07-24-see-what-a-queued-pull-request-is-waiting-on/The merge queue now shows which queued pull requests a pull request depends on, so its position in the queue is explained.Fri, 24 Jul 2026 00:00:00 GMTThe merge queue now shows which queued pull requests a pull request depends on, so its position in the queue is explained.Merge Queuehello@mergify.com (Mergify)Direct Merge for scope-unaffected pull requestshttps://docs.mergify.com/changelog/2026-07-20-direct-merge-for-scope-unaffected-pull-requests/https://docs.mergify.com/changelog/2026-07-20-direct-merge-for-scope-unaffected-pull-requests/A queued pull request that is behind the base branch only by merges touching other scopes is now merged immediately, with no draft pull request and no merge queue CI run.Mon, 20 Jul 2026 00:00:00 GMTA queued pull request that is behind the base branch only by merges touching other scopes is now merged immediately, with no draft pull request and no merge queue CI run.Merge Queuehello@mergify.com (Mergify)Declare merge queue barrier files in your configurationhttps://docs.mergify.com/changelog/2026-07-17-declare-merge-queue-barrier-files-in-your-configuration/https://docs.mergify.com/changelog/2026-07-17-declare-merge-queue-barrier-files-in-your-configuration/You can now mark files that impact every scope directly in your Mergify configuration, so any pull request touching them runs alone in the merge queue.Fri, 17 Jul 2026 00:00:00 GMTYou can now mark files that impact every scope directly in your Mergify configuration, so any pull request touching them runs alone in the merge queue.Merge Queuehello@mergify.com (Mergify)Merge queue stats metrics and dashboard in Datadoghttps://docs.mergify.com/changelog/2026-07-17-merge-queue-stats-metrics-and-dashboard-in-datadog/https://docs.mergify.com/changelog/2026-07-17-merge-queue-stats-metrics-and-dashboard-in-datadog/The Datadog integration now ships 19 new mergify.queue.\* metrics covering merge queue throughput, queue health, and performance, plus an out-of-the-box dashboard.Fri, 17 Jul 2026 00:00:00 GMTThe Datadog integration now ships 19 new mergify.queue.\* metrics covering merge queue throughput, queue health, and performance, plus an out-of-the-box dashboard.IntegrationsMerge Queuehello@mergify.com (Mergify)CI & Test Insights stats now available in the public APIhttps://docs.mergify.com/changelog/2026-07-08-ci-test-insights-stats-now-available-in-the-public-api/https://docs.mergify.com/changelog/2026-07-08-ci-test-insights-stats-now-available-in-the-public-api/The test, runner, and CI queue stats endpoints are now part of Mergify's public REST API, each returning a window summary value plus a per-day time series.Wed, 08 Jul 2026 00:00:00 GMTThe test, runner, and CI queue stats endpoints are now part of Mergify's public REST API, each returning a window summary value plus a per-day time series.CI InsightsTest Insightshello@mergify.com (Mergify)commit\_message\_template is deprecated — use commit\_message\_formathttps://docs.mergify.com/changelog/2026-07-08-commit-message-template-is-deprecated-use-commit-message-format/https://docs.mergify.com/changelog/2026-07-08-commit-message-template-is-deprecated-use-commit-message-format/The commit\_message\_template setting is deprecated in favor of the declarative commit\_message\_format and will be removed on September 30, 2026.Wed, 08 Jul 2026 00:00:00 GMTThe commit\_message\_template setting is deprecated in favor of the declarative commit\_message\_format and will be removed on September 30, 2026.Deprecationshello@mergify.com (Mergify)Dequeue a pull request from the merge queuehttps://docs.mergify.com/changelog/2026-07-08-dequeue-a-pull-request-from-the-merge-queue/https://docs.mergify.com/changelog/2026-07-08-dequeue-a-pull-request-from-the-merge-queue/Manually remove a queued pull request from the merge queue from the dashboard, with a confirmation dialog showing the impact.Wed, 08 Jul 2026 00:00:00 GMTManually remove a queued pull request from the merge queue from the dashboard, with a confirmation dialog showing the impact.Merge Queuehello@mergify.com (Mergify)Mark a pull request as impacting all CI scopeshttps://docs.mergify.com/changelog/2026-07-08-mark-a-pull-request-as-impacting-all-ci-scopes/https://docs.mergify.com/changelog/2026-07-08-mark-a-pull-request-as-impacting-all-ci-scopes/Report a pull request as impacting every CI scope so it serializes the merge queue, instead of enumerating every target.Wed, 08 Jul 2026 00:00:00 GMTReport a pull request as impacting every CI scope so it serializes the merge queue, instead of enumerating every target.Merge Queuehello@mergify.com (Mergify)Scopes and batch lineage in queue event logshttps://docs.mergify.com/changelog/2026-07-08-scopes-and-batch-lineage-in-queue-event-logs/https://docs.mergify.com/changelog/2026-07-08-scopes-and-batch-lineage-in-queue-event-logs/Merge queue check events now carry the batch's scopes and parent batch ids (plus a batch\_id on leave), so you can reconstruct check history from the event logs alone.Wed, 08 Jul 2026 00:00:00 GMTMerge queue check events now carry the batch's scopes and parent batch ids (plus a batch\_id on leave), so you can reconstruct check history from the event logs alone.Merge Queuehello@mergify.com (Mergify)skip\_intermediate\_results now works in parallel merge queue modehttps://docs.mergify.com/changelog/2026-07-08-skip-intermediate-results-now-works-in-parallel-merge-queue-mode/https://docs.mergify.com/changelog/2026-07-08-skip-intermediate-results-now-works-in-parallel-merge-queue-mode/The skip\_intermediate\_results option, previously serial-only, now also speeds up merges in parallel mode within each scope's dependency chain.Wed, 08 Jul 2026 00:00:00 GMTThe skip\_intermediate\_results option, previously serial-only, now also speeds up merges in parallel mode within each scope's dependency chain.Merge Queuehello@mergify.com (Mergify)Trace a restarted batch back to its previous attempthttps://docs.mergify.com/changelog/2026-07-08-trace-a-restarted-batch-back-to-its-previous-attempt/https://docs.mergify.com/changelog/2026-07-08-trace-a-restarted-batch-back-to-its-previous-attempt/The merge queue activity log now links a restarted batch to the previous batch it retried.Wed, 08 Jul 2026 00:00:00 GMTThe merge queue activity log now links a restarted batch to the previous batch it retried.Merge Queuehello@mergify.com (Mergify)Mention assignees and approvers in comment, review, and close messageshttps://docs.mergify.com/changelog/2026-06-29-mention-assignees-and-approvers-in-comment-review-and-close-messages/https://docs.mergify.com/changelog/2026-06-29-mention-assignees-and-approvers-in-comment-review-and-close-messages/The comment, review, and close actions can now reference a pull request's assignees and approvers as ready-to-use @-mentions in their messages.Mon, 29 Jun 2026 00:00:00 GMTThe comment, review, and close actions can now reference a pull request's assignees and approvers as ready-to-use @-mentions in their messages.Workflow Automationhello@mergify.com (Mergify)Merge queues use an automatic checks timeout by defaulthttps://docs.mergify.com/changelog/2026-06-29-merge-queues-use-an-automatic-checks-timeout-by-default/https://docs.mergify.com/changelog/2026-06-29-merge-queues-use-an-automatic-checks-timeout-by-default/Merge queues now default to an automatically computed checks timeout based on each queue's recent CI runtime.Mon, 29 Jun 2026 00:00:00 GMTMerge queues now default to an automatically computed checks timeout based on each queue's recent CI runtime.Merge Queuehello@mergify.com (Mergify)Safe templating for backport and copy titles & bodieshttps://docs.mergify.com/changelog/2026-06-29-safe-templating-for-backport-and-copy-titles-bodies/https://docs.mergify.com/changelog/2026-06-29-safe-templating-for-backport-and-copy-titles-bodies/The copy and backport actions' title and body now use Mergify's safe {{ variable }} templating, and Jinja2 expressions in these fields are deprecated.Mon, 29 Jun 2026 00:00:00 GMTThe copy and backport actions' title and body now use Mergify's safe {{ variable }} templating, and Jinja2 expressions in these fields are deprecated.Workflow Automationhello@mergify.com (Mergify)Safe templating for GitHub Actions workflow inputshttps://docs.mergify.com/changelog/2026-06-29-safe-templating-for-github-actions-workflow-inputs/https://docs.mergify.com/changelog/2026-06-29-safe-templating-for-github-actions-workflow-inputs/Workflow-dispatch inputs in the github\_actions action now use safe {{ variable }} templating, with raw Jinja2 deprecated.Mon, 29 Jun 2026 00:00:00 GMTWorkflow-dispatch inputs in the github\_actions action now use safe {{ variable }} templating, with raw Jinja2 deprecated.Workflow Automationhello@mergify.com (Mergify)Built-in author and merger options for assignee fieldshttps://docs.mergify.com/changelog/2026-06-19-built-in-author-and-merger-options-for-assignee-fields/https://docs.mergify.com/changelog/2026-06-19-built-in-author-and-merger-options-for-assignee-fields/The assign, copy, and backport actions now accept {{ author }} (and {{ merged\_by }} for copy/backport) as named, built-in options for their assignee lists.Fri, 19 Jun 2026 00:00:00 GMTThe assign, copy, and backport actions now accept {{ author }} (and {{ merged\_by }} for copy/backport) as named, built-in options for their assignee lists.Ruleshello@mergify.com (Mergify)Dynamic merge queue batch sizehttps://docs.mergify.com/changelog/2026-06-19-dynamic-merge-queue-batch-size/https://docs.mergify.com/changelog/2026-06-19-dynamic-merge-queue-batch-size/Configure batch\_size as a {min, max} range and the merge queue scales batch size automatically — small when quiet, larger to absorb backlog.Fri, 19 Jun 2026 00:00:00 GMTConfigure batch\_size as a {min, max} range and the merge queue scales batch size automatically — small when quiet, larger to absorb backlog.Merge Queuehello@mergify.com (Mergify)Impersonate the pull request author with a static \`{{ author }}\` bot accounthttps://docs.mergify.com/changelog/2026-06-19-impersonate-the-pull-request-author-with-a-static-author-bot-account/https://docs.mergify.com/changelog/2026-06-19-impersonate-the-pull-request-author-with-a-static-author-bot-account/\`{{ author }}\` is now a static \`bot\_account\` value that impersonates the pull request author in every action and queue rule, accepted anywhere.Fri, 19 Jun 2026 00:00:00 GMT\`{{ author }}\` is now a static \`bot\_account\` value that impersonates the pull request author in every action and queue rule, accepted anywhere.Ruleshello@mergify.com (Mergify)Merge protections honor GitHub's "require approval of most recent push"https://docs.mergify.com/changelog/2026-06-19-merge-protections-honor-githubs-require-approval-of-most-recent-push/https://docs.mergify.com/changelog/2026-06-19-merge-protections-honor-githubs-require-approval-of-most-recent-push/Mergify now respects GitHub's "Require approval of the most recent push" branch-protection option when evaluating merge protections.Fri, 19 Jun 2026 00:00:00 GMTMergify now respects GitHub's "Require approval of the most recent push" branch-protection option when evaluating merge protections.Merge Protectionshello@mergify.com (Mergify)Queue or requeue a pull request with a checkboxhttps://docs.mergify.com/changelog/2026-06-19-queue-or-requeue-a-pull-request-with-a-checkbox/https://docs.mergify.com/changelog/2026-06-19-queue-or-requeue-a-pull-request-with-a-checkbox/Queue or requeue a pull request by ticking a checkbox in the Mergify status comment, without typing a command.Fri, 19 Jun 2026 00:00:00 GMTQueue or requeue a pull request by ticking a checkbox in the Mergify status comment, without typing a command.Merge Queuehello@mergify.com (Mergify)Reference the pull request author in conditions with {{ author }}https://docs.mergify.com/changelog/2026-06-19-reference-the-pull-request-author-in-conditions-with-author/https://docs.mergify.com/changelog/2026-06-19-reference-the-pull-request-author-in-conditions-with-author/Rule conditions now accept {{ author }} as a built-in value for matching an attribute against the pull request author.Fri, 19 Jun 2026 00:00:00 GMTRule conditions now accept {{ author }} as a built-in value for matching an attribute against the pull request author.Ruleshello@mergify.com (Mergify)Self-hosted Runners: Fleet & queue metricshttps://docs.mergify.com/changelog/2026-06-19-self-hosted-runners-fleet-queue-metrics/https://docs.mergify.com/changelog/2026-06-19-self-hosted-runners-fleet-queue-metrics/A capacity view of your self-hosted runner fleet — utilization, saturation, active vs. available runners, and queue-wait time broken down by the labels jobs request.Fri, 19 Jun 2026 00:00:00 GMTA capacity view of your self-hosted runner fleet — utilization, saturation, active vs. available runners, and queue-wait time broken down by the labels jobs request.CI Insightshello@mergify.com (Mergify)Slack notifications for quarantined testshttps://docs.mergify.com/changelog/2026-06-19-slack-notifications-for-quarantined-tests/https://docs.mergify.com/changelog/2026-06-19-slack-notifications-for-quarantined-tests/Mergify can now post a Slack message whenever a test is quarantined or dequarantined, so your team sees mitigation activity in real time.Fri, 19 Jun 2026 00:00:00 GMTMergify can now post a Slack message whenever a test is quarantined or dequarantined, so your team sees mitigation activity in real time.Test Insightshello@mergify.com (Mergify)Set your merge queue checks timeout automaticallyhttps://docs.mergify.com/changelog/2026-06-11-set-your-merge-queue-checks-timeout-automatically/https://docs.mergify.com/changelog/2026-06-11-set-your-merge-queue-checks-timeout-automatically/Merge queues can now compute their checks timeout from recent CI runtimes with \`checks\_timeout: auto\`, instead of requiring a fixed value.Thu, 11 Jun 2026 00:00:00 GMTMerge queues can now compute their checks timeout from recent CI runtimes with \`checks\_timeout: auto\`, instead of requiring a fixed value.Merge Queuehello@mergify.com (Mergify)Address cancelled checks separately with check-cancelledhttps://docs.mergify.com/changelog/2026-06-09-address-cancelled-checks-separately-with-check-cancelled/https://docs.mergify.com/changelog/2026-06-09-address-cancelled-checks-separately-with-check-cancelled/A new check-cancelled condition attribute matches checks with a cancelled conclusion independently from check-failure.Tue, 09 Jun 2026 00:00:00 GMTA new check-cancelled condition attribute matches checks with a cancelled conclusion independently from check-failure.Ruleshello@mergify.com (Mergify)Limit concurrent checks per scopehttps://docs.mergify.com/changelog/2026-06-03-limit-concurrent-checks-per-scope/https://docs.mergify.com/changelog/2026-06-03-limit-concurrent-checks-per-scope/Cap how many speculative checks run in parallel for each merge queue scope, so heavy areas of your monorepo can't starve the rest.Wed, 03 Jun 2026 00:00:00 GMTCap how many speculative checks run in parallel for each merge queue scope, so heavy areas of your monorepo can't starve the rest.Merge Queuehello@mergify.com (Mergify)Auto-group queued pull requests by changed fileshttps://docs.mergify.com/changelog/2026-06-02-auto-group-queued-pull-requests-by-changed-files/https://docs.mergify.com/changelog/2026-06-02-auto-group-queued-pull-requests-by-changed-files/Mergify now batches queued pull requests that touch similar files together automatically, with no scopes, CI action, or API setup.Tue, 02 Jun 2026 00:00:00 GMTMergify now batches queued pull requests that touch similar files together automatically, with no scopes, CI action, or API setup.Merge Queuehello@mergify.com (Mergify)Auto-retry rules are now scoped per repositoryhttps://docs.mergify.com/changelog/2026-06-02-auto-retry-rules-are-now-scoped-per-repository/https://docs.mergify.com/changelog/2026-06-02-auto-retry-rules-are-now-scoped-per-repository/Auto-retry rules are now managed per repository instead of organization-wide, with a repository selector at the top of the page.Tue, 02 Jun 2026 00:00:00 GMTAuto-retry rules are now managed per repository instead of organization-wide, with a repository selector at the top of the page.CI Insightshello@mergify.com (Mergify)Configure merge queue commit message format from the dashboardhttps://docs.mergify.com/changelog/2026-06-02-configure-merge-queue-commit-message-format-from-the-dashboard/https://docs.mergify.com/changelog/2026-06-02-configure-merge-queue-commit-message-format-from-the-dashboard/A new modal editor lets you configure the declarative commit\_message\_format for queue rules directly from the dashboard.Tue, 02 Jun 2026 00:00:00 GMTA new modal editor lets you configure the declarative commit\_message\_format for queue rules directly from the dashboard.Merge Queuehello@mergify.com (Mergify)Honor GitHub ruleset required reviewershttps://docs.mergify.com/changelog/2026-06-02-honor-github-ruleset-required-reviewers/https://docs.mergify.com/changelog/2026-06-02-honor-github-ruleset-required-reviewers/Mergify now waits for the team and user approvals required by GitHub rulesets before merging.Tue, 02 Jun 2026 00:00:00 GMTMergify now waits for the team and user approvals required by GitHub rulesets before merging.Merge Protectionshello@mergify.com (Mergify)Isolated merge queue modehttps://docs.mergify.com/changelog/2026-06-02-isolated-merge-queue-mode/https://docs.mergify.com/changelog/2026-06-02-isolated-merge-queue-mode/A new \`isolated\` merge queue mode runs every batch as a fully independent car, so a failure or delay in one batch never blocks the others.Tue, 02 Jun 2026 00:00:00 GMTA new \`isolated\` merge queue mode runs every batch as a fully independent car, so a failure or delay in one batch never blocks the others.Merge Queuehello@mergify.com (Mergify)Mergify Stacks adoption in the dashboardhttps://docs.mergify.com/changelog/2026-06-02-mergify-stacks-adoption-in-the-dashboard/https://docs.mergify.com/changelog/2026-06-02-mergify-stacks-adoption-in-the-dashboard/See how your team is using Mergify Stacks — install commands to share, plus a live adoption page with active stacks, repos using it, and trends over time.Tue, 02 Jun 2026 00:00:00 GMTSee how your team is using Mergify Stacks — install commands to share, plus a live adoption page with active stacks, repos using it, and trends over time.APIhello@mergify.com (Mergify)New activity log pagehttps://docs.mergify.com/changelog/2026-06-02-new-activity-log-page/https://docs.mergify.com/changelog/2026-06-02-new-activity-log-page/The Activity Log, a faster, filterable view of every Mergify event. Now replaces Event Logs on all repositories.Tue, 02 Jun 2026 00:00:00 GMTThe Activity Log, a faster, filterable view of every Mergify event. Now replaces Event Logs on all repositories.Merge Queuehello@mergify.com (Mergify)Scope \`check-\*\` conditions to a specific GitHub Apphttps://docs.mergify.com/changelog/2026-06-02-scope-check-conditions-to-a-specific-github-app/https://docs.mergify.com/changelog/2026-06-02-scope-check-conditions-to-a-specific-github-app/Bind a \`check-\*\` condition to the GitHub App that posted the check, so collisions from other installations cannot satisfy the rule.Tue, 02 Jun 2026 00:00:00 GMTBind a \`check-\*\` condition to the GitHub App that posted the check, so collisions from other installations cannot satisfy the rule.Ruleshello@mergify.com (Mergify)Automatic migration from \`autoqueue\` to \`auto\_merge\_conditions\`https://docs.mergify.com/changelog/2026-05-06-automatic-migration-from-autoqueue-to-auto-merge-conditions/https://docs.mergify.com/changelog/2026-05-06-automatic-migration-from-autoqueue-to-auto-merge-conditions/Mergify now opens a migration PR that converts the deprecated \`queue\_rules\[\].autoqueue\` setting to the new \`merge\_protection\_settings.auto\_merge\_conditions\`.Wed, 06 May 2026 00:00:00 GMTMergify now opens a migration PR that converts the deprecated \`queue\_rules\[\].autoqueue\` setting to the new \`merge\_protection\_settings.auto\_merge\_conditions\`.Merge Queuehello@mergify.com (Mergify)\`conditions\` in queue rules is deprecatedhttps://docs.mergify.com/changelog/2026-05-06-conditions-in-queue-rules-is-deprecated/https://docs.mergify.com/changelog/2026-05-06-conditions-in-queue-rules-is-deprecated/The \`conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`merge\_conditions\` instead.Wed, 06 May 2026 00:00:00 GMTThe \`conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`merge\_conditions\` instead.DeprecationsMerge Queuehello@mergify.com (Mergify)Declarative \`commit\_message\_format\` for merge commitshttps://docs.mergify.com/changelog/2026-05-06-declarative-commit-message-format-for-merge-commits/https://docs.mergify.com/changelog/2026-05-06-declarative-commit-message-format-for-merge-commits/Configure merge commit titles, bodies, and trailers declaratively without writing Jinja2 templates.Wed, 06 May 2026 00:00:00 GMTConfigure merge commit titles, bodies, and trailers declaratively without writing Jinja2 templates.Merge QueueWorkflow Automationhello@mergify.com (Mergify)Delegate Mergify admin powers to non-GitHub Ownershttps://docs.mergify.com/changelog/2026-05-06-delegate-mergify-admin-powers-to-non-github-owners/https://docs.mergify.com/changelog/2026-05-06-delegate-mergify-admin-powers-to-non-github-owners/GitHub Owners can now delegate specific Mergify admin powers to individual users without granting them GitHub Owner rights.Wed, 06 May 2026 00:00:00 GMTGitHub Owners can now delegate specific Mergify admin powers to individual users without granting them GitHub Owner rights.hello@mergify.com (Mergify)Restrict auto-merge to specific pull requests with \`auto\_merge\_conditions\`https://docs.mergify.com/changelog/2026-05-06-restrict-auto-merge-to-specific-pull-requests-with-auto-merge-conditions/https://docs.mergify.com/changelog/2026-05-06-restrict-auto-merge-to-specific-pull-requests-with-auto-merge-conditions/Configure which pull requests are eligible for auto-merge using a list of conditions instead of a global on/off toggle.Wed, 06 May 2026 00:00:00 GMTConfigure which pull requests are eligible for auto-merge using a list of conditions instead of a global on/off toggle.Merge Protectionshello@mergify.com (Mergify)\`routing\_conditions\` in queue rules is deprecatedhttps://docs.mergify.com/changelog/2026-05-06-routing-conditions-in-queue-rules-is-deprecated/https://docs.mergify.com/changelog/2026-05-06-routing-conditions-in-queue-rules-is-deprecated/The \`routing\_conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`queue\_conditions\` instead.Wed, 06 May 2026 00:00:00 GMTThe \`routing\_conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`queue\_conditions\` instead.DeprecationsMerge Queuehello@mergify.com (Mergify)Mergify Terraform providerhttps://docs.mergify.com/changelog/2026-05-05-mergify-terraform-provider/https://docs.mergify.com/changelog/2026-05-05-mergify-terraform-provider/Manage Mergify product enablement declaratively with TerraformTue, 05 May 2026 00:00:00 GMTManage Mergify product enablement declaratively with TerraformIntegrationshello@mergify.com (Mergify)\`unqueue\` command alias removedhttps://docs.mergify.com/changelog/2026-05-05-unqueue-command-alias-removed/https://docs.mergify.com/changelog/2026-05-05-unqueue-command-alias-removed/The deprecated \`unqueue\` command alias has been removed; use \`dequeue\` instead.Tue, 05 May 2026 00:00:00 GMTThe deprecated \`unqueue\` command alias has been removed; use \`dequeue\` instead.Workflow Automationhello@mergify.com (Mergify)Buildkite support for CI Insightshttps://docs.mergify.com/changelog/2026-04-22-buildkite-support-for-ci-insights/https://docs.mergify.com/changelog/2026-04-22-buildkite-support-for-ci-insights/Connect your Buildkite pipelines to Mergify CI Insights to track build and job performance alongside your GitHub Actions and Jenkins data.Wed, 22 Apr 2026 00:00:00 GMTConnect your Buildkite pipelines to Mergify CI Insights to track build and job performance alongside your GitHub Actions and Jenkins data.CI Insightshello@mergify.com (Mergify)Auto-merge setting in Merge Protectionshttps://docs.mergify.com/changelog/2026-04-21-auto-merge-setting-in-merge-protections/https://docs.mergify.com/changelog/2026-04-21-auto-merge-setting-in-merge-protections/New auto\_merge setting that automatically merges or queues PRs when all merge protection conditions pass, replacing the deprecated autoqueue in queue rules.Tue, 21 Apr 2026 00:00:00 GMTNew auto\_merge setting that automatically merges or queues PRs when all merge protection conditions pass, replacing the deprecated autoqueue in queue rules.Merge ProtectionsDeprecationshello@mergify.com (Mergify)Automated migration for check interruption default changehttps://docs.mergify.com/changelog/2026-04-21-automated-migration-for-check-interruption-default-change/https://docs.mergify.com/changelog/2026-04-21-automated-migration-for-check-interruption-default-change/An automated configuration migration adds explicit \`allow\_checks\_interruption: true\` to priority rules with priority higher than medium, preparing for the upcoming default change.Tue, 21 Apr 2026 00:00:00 GMTAn automated configuration migration adds explicit \`allow\_checks\_interruption: true\` to priority rules with priority higher than medium, preparing for the upcoming default change.Merge Queuehello@mergify.com (Mergify)Check interruption disabled by default for priority ruleshttps://docs.mergify.com/changelog/2026-04-21-check-interruption-disabled-by-default-for-priority-rules/https://docs.mergify.com/changelog/2026-04-21-check-interruption-disabled-by-default-for-priority-rules/The default for \`allow\_checks\_interruption\` in priority rules changes from true to false, so higher-priority pull requests no longer interrupt running checks unless explicitly configured.Tue, 21 Apr 2026 00:00:00 GMTThe default for \`allow\_checks\_interruption\` in priority rules changes from true to false, so higher-priority pull requests no longer interrupt running checks unless explicitly configured.Merge Queuehello@mergify.com (Mergify)Extended statistics date range to 3 monthshttps://docs.mergify.com/changelog/2026-04-21-extended-statistics-date-range-to-3-months/https://docs.mergify.com/changelog/2026-04-21-extended-statistics-date-range-to-3-months/You can now view merge queue statistics for up to 3 months instead of the previous 1-month limit.Tue, 21 Apr 2026 00:00:00 GMTYou can now view merge queue statistics for up to 3 months instead of the previous 1-month limit.Merge Queuehello@mergify.com (Mergify)Merge queue rebase with update\_bot\_account on fork pull requestshttps://docs.mergify.com/changelog/2026-04-21-merge-queue-rebase-with-update-bot-account-on-fork-pull-requests/https://docs.mergify.com/changelog/2026-04-21-merge-queue-rebase-with-update-bot-account-on-fork-pull-requests/Using the merge queue with \`update\_method=rebase\` and \`update\_bot\_account\` on fork pull requests is deprecated and will be removed on July 1, 2026.Tue, 21 Apr 2026 00:00:00 GMTUsing the merge queue with \`update\_method=rebase\` and \`update\_bot\_account\` on fork pull requests is deprecated and will be removed on July 1, 2026.Deprecationshello@mergify.com (Mergify)Pull request scopes API is now publichttps://docs.mergify.com/changelog/2026-04-21-pull-request-scopes-api-is-now-public/https://docs.mergify.com/changelog/2026-04-21-pull-request-scopes-api-is-now-public/The endpoint to set scopes on pull requests is now available in the public API.Tue, 21 Apr 2026 00:00:00 GMTThe endpoint to set scopes on pull requests is now available in the public API.APIhello@mergify.com (Mergify)Unified "Mergify Merge Queue" check runhttps://docs.mergify.com/changelog/2026-04-21-unified-mergify-merge-queue-check-run/https://docs.mergify.com/changelog/2026-04-21-unified-mergify-merge-queue-check-run/A single "Mergify Merge Queue" check run on pull requests, providing a unified view of merge queue status.Tue, 21 Apr 2026 00:00:00 GMTA single "Mergify Merge Queue" check run on pull requests, providing a unified view of merge queue status.Merge Queuehello@mergify.com (Mergify)Regex tester for auto-retry log patternshttps://docs.mergify.com/changelog/2026-04-14-regex-tester-for-auto-retry-log-patterns/https://docs.mergify.com/changelog/2026-04-14-regex-tester-for-auto-retry-log-patterns/Test your regex patterns against sample log lines directly in the auto-retry rule builder.Tue, 14 Apr 2026 00:00:00 GMTTest your regex patterns against sample log lines directly in the auto-retry rule builder.CI Insightshello@mergify.com (Mergify)Parallel scopeshttps://docs.mergify.com/changelog/2026-04-13-parallel-scopes/https://docs.mergify.com/changelog/2026-04-13-parallel-scopes/Merge unrelated pull requests in parallel by grouping them into scopes based on the files they touch.Mon, 13 Apr 2026 00:00:00 GMTMerge unrelated pull requests in parallel by grouping them into scopes based on the files they touch.Merge Queuehello@mergify.com (Mergify)New \`scope\` attribute available for conditionshttps://docs.mergify.com/changelog/2026-04-09-new-scope-attribute-available-for-conditions/https://docs.mergify.com/changelog/2026-04-09-new-scope-attribute-available-for-conditions/A new \`scope\` field is now exposed through pull requests attributes and can be used in conditionsThu, 09 Apr 2026 00:00:00 GMTA new \`scope\` field is now exposed through pull requests attributes and can be used in conditionsMerge ProtectionsMerge QueueWorkflow Automationhello@mergify.com (Mergify)Native RSpec Integration for Test Insightshttps://docs.mergify.com/changelog/2026-04-07-native-rspec-integration-for-test-insights/https://docs.mergify.com/changelog/2026-04-07-native-rspec-integration-for-test-insights/RSpec projects can now use the rspec-mergify gem for automatic test result upload, flaky test detection, and flaky test preventionTue, 07 Apr 2026 00:00:00 GMTRSpec projects can now use the rspec-mergify gem for automatic test result upload, flaky test detection, and flaky test preventionTest Insightshello@mergify.com (Mergify)New merge-batch merge method for merge queuehttps://docs.mergify.com/changelog/2026-04-07-new-merge-batch-merge-method-for-merge-queue/https://docs.mergify.com/changelog/2026-04-07-new-merge-batch-merge-method-for-merge-queue/A new merge-batch merge method merges the draft pull request prepared by the merge queue directly into the base branchTue, 07 Apr 2026 00:00:00 GMTA new merge-batch merge method merges the draft pull request prepared by the merge queue directly into the base branchMerge Queuehello@mergify.com (Mergify)\`rebase\` action with \`bot\_account\` on fork pull requestshttps://docs.mergify.com/changelog/2026-04-07-rebase-action-with-bot-account-on-fork-pull-requests/https://docs.mergify.com/changelog/2026-04-07-rebase-action-with-bot-account-on-fork-pull-requests/The \`rebase\` action with \`bot\_account\` impersonation on fork pull requests is deprecated and will be removed on July 1, 2026.Tue, 07 Apr 2026 00:00:00 GMTThe \`rebase\` action with \`bot\_account\` impersonation on fork pull requests is deprecated and will be removed on July 1, 2026.Deprecationshello@mergify.com (Mergify)Deprecation of queue\_branch\_merge\_methodhttps://docs.mergify.com/changelog/2026-04-01-deprecation-of-queue-branch-merge-method/https://docs.mergify.com/changelog/2026-04-01-deprecation-of-queue-branch-merge-method/queue\_branch\_merge\_method is deprecated in favor of merge\_method: fast-forward, which now works in both inplace and draft-PR modes.Wed, 01 Apr 2026 00:00:00 GMTqueue\_branch\_merge\_method is deprecated in favor of merge\_method: fast-forward, which now works in both inplace and draft-PR modes.DeprecationsMerge Queuehello@mergify.com (Mergify)Deprecation of action delete\_head\_branchhttps://docs.mergify.com/changelog/2026-03-30-deprecation-of-action-delete-head-branch/https://docs.mergify.com/changelog/2026-03-30-deprecation-of-action-delete-head-branch/The \`delete\_head\_branch\` action is deprecated. Mon, 30 Mar 2026 00:00:00 GMTThe \`delete\_head\_branch\` action is deprecated. Deprecationshello@mergify.com (Mergify)Match CI log patterns against check run annotationshttps://docs.mergify.com/changelog/2026-03-30-match-ci-log-patterns-against-check-run-annotations/https://docs.mergify.com/changelog/2026-03-30-match-ci-log-patterns-against-check-run-annotations/Auto-retry log patterns now also match against GitHub check run annotations, not just log output.Mon, 30 Mar 2026 00:00:00 GMTAuto-retry log patterns now also match against GitHub check run annotations, not just log output.CI Insightshello@mergify.com (Mergify)Log pattern matching for auto-retry ruleshttps://docs.mergify.com/changelog/2026-03-23-log-pattern-matching-for-auto-retry-rules/https://docs.mergify.com/changelog/2026-03-23-log-pattern-matching-for-auto-retry-rules/Auto-Retry rules can now match against job log content to decide whether a failed job should be retriedMon, 23 Mar 2026 00:00:00 GMTAuto-Retry rules can now match against job log content to decide whether a failed job should be retriedCI Insightshello@mergify.com (Mergify)Merge Queue: PR exit reasons and idle time breakdown in statshttps://docs.mergify.com/changelog/2026-03-20-merge-queue-pr-exit-reasons-and-idle-time-breakdown-in-stats/https://docs.mergify.com/changelog/2026-03-20-merge-queue-pr-exit-reasons-and-idle-time-breakdown-in-stats/New stats endpoints for the merge queue dashboard: PR exit reasons count (unique PRs by final exit reason) and idle time breakdown (capacity, schedule, freeze). Powers the new Sankey flow diagram and stacked time chart.Fri, 20 Mar 2026 00:00:00 GMTNew stats endpoints for the merge queue dashboard: PR exit reasons count (unique PRs by final exit reason) and idle time breakdown (capacity, schedule, freeze). Powers the new Sankey flow diagram and stacked time chart.Merge Queuehello@mergify.com (Mergify)Automatic CI retries in merge queuehttps://docs.mergify.com/changelog/2026-03-18-automatic-ci-retries-in-merge-queue/https://docs.mergify.com/changelog/2026-03-18-automatic-ci-retries-in-merge-queue/You can now configure Mergify to automatically retry failed CI checks before removing a pull request from the queue.Wed, 18 Mar 2026 00:00:00 GMTYou can now configure Mergify to automatically retry failed CI checks before removing a pull request from the queue.Merge Queuehello@mergify.com (Mergify)Deprecation of \`post\_check\` actionhttps://docs.mergify.com/changelog/2026-03-18-deprecation-of-post-check-action/https://docs.mergify.com/changelog/2026-03-18-deprecation-of-post-check-action/Automatic migration of post\_check actions to merge\_protections entriesWed, 18 Mar 2026 00:00:00 GMTAutomatic migration of post\_check actions to merge\_protections entriesDeprecationsMerge Protectionshello@mergify.com (Mergify)Time-binned merge queue checks outcome endpointhttps://docs.mergify.com/changelog/2026-03-17-time-binned-merge-queue-checks-outcome-endpoint/https://docs.mergify.com/changelog/2026-03-17-time-binned-merge-queue-checks-outcome-endpoint/New API endpoint to track dequeue reasons over time as a time-series graphTue, 17 Mar 2026 00:00:00 GMTNew API endpoint to track dequeue reasons over time as a time-series graphMerge QueueAPIhello@mergify.com (Mergify)Merge queue intake statistics endpointhttps://docs.mergify.com/changelog/2026-03-13-merge-queue-intake-statistics-endpoint/https://docs.mergify.com/changelog/2026-03-13-merge-queue-intake-statistics-endpoint/New API endpoint to track pull requests entering the merge queue over timeFri, 13 Mar 2026 00:00:00 GMTNew API endpoint to track pull requests entering the merge queue over timeMerge QueueAPIhello@mergify.com (Mergify)Batch bisection statistics APIhttps://docs.mergify.com/changelog/2026-03-12-batch-bisection-statistics-api/https://docs.mergify.com/changelog/2026-03-12-batch-bisection-statistics-api/New API endpoint to track merge queue bisection events, helping users optimize their batch size configuration.Thu, 12 Mar 2026 00:00:00 GMTNew API endpoint to track merge queue bisection events, helping users optimize their batch size configuration.Merge QueueAPIhello@mergify.com (Mergify)Test Insights: mitigationhttps://docs.mergify.com/changelog/2026-03-12-test-insights-mitigation/https://docs.mergify.com/changelog/2026-03-12-test-insights-mitigation/View quarantined tests on the default branch and turn auto-quarantine on so flaky tests don’t block merges.Thu, 12 Mar 2026 00:00:00 GMTView quarantined tests on the default branch and turn auto-quarantine on so flaky tests don’t block merges.Test Insightshello@mergify.com (Mergify)Merge Queue failure rate statisticshttps://docs.mergify.com/changelog/2026-03-11-merge-queue-failure-rate-statistics/https://docs.mergify.com/changelog/2026-03-11-merge-queue-failure-rate-statistics/A new failure\_rate endpoint is available in the merge queue statistics API, returning the ratio of failed to total PRs leaving the queue, broken down by time intervals.Wed, 11 Mar 2026 00:00:00 GMTA new failure\_rate endpoint is available in the merge queue statistics API, returning the ratio of failed to total PRs leaving the queue, broken down by time intervals.APIMerge Queuehello@mergify.com (Mergify)Test Insights: prevention and detectionhttps://docs.mergify.com/changelog/2026-03-11-test-insights-prevention-and-detection/https://docs.mergify.com/changelog/2026-03-11-test-insights-prevention-and-detection/Stop flaky tests from slowing you down. Prevention shows what gets caught before merge; Detection helps you find and fix the worst offenders.Wed, 11 Mar 2026 00:00:00 GMTStop flaky tests from slowing you down. Prevention shows what gets caught before merge; Detection helps you find and fix the worst offenders.Test Insightshello@mergify.com (Mergify)API support for GitHub PAThttps://docs.mergify.com/changelog/2026-03-04-api-support-for-github-pat/https://docs.mergify.com/changelog/2026-03-04-api-support-for-github-pat/It’s possible for users to use the APIWed, 04 Mar 2026 00:00:00 GMTIt’s possible for users to use the APIAPIhello@mergify.com (Mergify)The requeue command is deprecatedhttps://docs.mergify.com/changelog/2026-02-18-the-requeue-command-is-deprecated/https://docs.mergify.com/changelog/2026-02-18-the-requeue-command-is-deprecated/The queue command can now requeue pull requestsWed, 18 Feb 2026 00:00:00 GMTThe queue command can now requeue pull requestsMerge QueueWorkflow AutomationDeprecationshello@mergify.com (Mergify)New retry mode for failed jobshttps://docs.mergify.com/changelog/2026-01-28-new-retry-mode-for-failed-jobs/https://docs.mergify.com/changelog/2026-01-28-new-retry-mode-for-failed-jobs/CI Insights Auto Retry gets a new retry modeWed, 28 Jan 2026 00:00:00 GMTCI Insights Auto Retry gets a new retry modeCI Insightshello@mergify.com (Mergify)\`autosquash\` has been deprecatedhttps://docs.mergify.com/changelog/2026-01-27-autosquash-has-been-deprecated/https://docs.mergify.com/changelog/2026-01-27-autosquash-has-been-deprecated/\`autosquash\` option will be removed soonTue, 27 Jan 2026 00:00:00 GMT\`autosquash\` option will be removed soonDeprecationshello@mergify.com (Mergify)Add ability for retry rules to retry entire pipelineshttps://docs.mergify.com/changelog/2026-01-19-add-ability-for-retry-rules-to-retry-entire-pipelines/https://docs.mergify.com/changelog/2026-01-19-add-ability-for-retry-rules-to-retry-entire-pipelines/Allow users to retry rules by choosing the retry modeMon, 19 Jan 2026 00:00:00 GMTAllow users to retry rules by choosing the retry modeCI Insightshello@mergify.com (Mergify)Allow to configure schedule freeze exclusion conditionshttps://docs.mergify.com/changelog/2026-01-13-allow-to-configure-schedule-freeze-exclusion-conditions/https://docs.mergify.com/changelog/2026-01-13-allow-to-configure-schedule-freeze-exclusion-conditions/Schedule Freeze exclusion conditions can now be configuredTue, 13 Jan 2026 00:00:00 GMTSchedule Freeze exclusion conditions can now be configuredMerge Protectionshello@mergify.com (Mergify)New Merge Queue status dashboardhttps://docs.mergify.com/changelog/2026-01-13-new-merge-queue-status-dashboard/https://docs.mergify.com/changelog/2026-01-13-new-merge-queue-status-dashboard/The redesigned merge queue interface is now available to everyoneTue, 13 Jan 2026 00:00:00 GMTThe redesigned merge queue interface is now available to everyoneMerge Queuehello@mergify.com (Mergify)Add none option to status\_comments for merge queuehttps://docs.mergify.com/changelog/2026-01-07-add-none-option-to-status-comments-for-merge-queue/https://docs.mergify.com/changelog/2026-01-07-add-none-option-to-status-comments-for-merge-queue/A new \`none\` value is now available for the \`status\_comments\` configuration option to completely disable merge queue status comments on pull requests. Wed, 07 Jan 2026 00:00:00 GMTA new \`none\` value is now available for the \`status\_comments\` configuration option to completely disable merge queue status comments on pull requests. Merge Queuehello@mergify.com (Mergify)Allow to configure merge queue comment reportinghttps://docs.mergify.com/changelog/2025-12-24-allow-to-configure-merge-queue-comment-reporting/https://docs.mergify.com/changelog/2025-12-24-allow-to-configure-merge-queue-comment-reporting/The status reported by the merge queue as comments can now be configuredWed, 24 Dec 2025 00:00:00 GMTThe status reported by the merge queue as comments can now be configuredMerge Queuehello@mergify.com (Mergify)Improved Merge Queue status reportinghttps://docs.mergify.com/changelog/2025-12-11-improved-merge-queue-status-reporting/https://docs.mergify.com/changelog/2025-12-11-improved-merge-queue-status-reporting/Release of the Merge Queue status updatesThu, 11 Dec 2025 00:00:00 GMTRelease of the Merge Queue status updatesMerge Queuehello@mergify.com (Mergify)Improved Merge Queue status reporting (beta)https://docs.mergify.com/changelog/2025-11-27-improved-merge-queue-status-reporting-beta/https://docs.mergify.com/changelog/2025-11-27-improved-merge-queue-status-reporting-beta/Improved Merge Queue status updates now give clearer, real-time insights into PR progress.Thu, 27 Nov 2025 00:00:00 GMTImproved Merge Queue status updates now give clearer, real-time insights into PR progress.Merge Queuehello@mergify.com (Mergify)Bypass the injection of rulesets conditions in the Merge Queuehttps://docs.mergify.com/changelog/2025-11-20-bypass-the-injection-of-rulesets-conditions-in-the-merge-queue/https://docs.mergify.com/changelog/2025-11-20-bypass-the-injection-of-rulesets-conditions-in-the-merge-queue/Use the \`exempt\` bypass-actor mode for Mergify in your ruleset to skip injecting ruleset conditions into the Merge Queue.Thu, 20 Nov 2025 00:00:00 GMTUse the \`exempt\` bypass-actor mode for Mergify in your ruleset to skip injecting ruleset conditions into the Merge Queue.Merge ProtectionsMerge Queuehello@mergify.com (Mergify)Adding merge queue commands to event loghttps://docs.mergify.com/changelog/2025-11-14-adding-merge-queue-commands-to-event-log/https://docs.mergify.com/changelog/2025-11-14-adding-merge-queue-commands-to-event-log/Commands for the merge queue are now recorded as part of the event logFri, 14 Nov 2025 00:00:00 GMTCommands for the merge queue are now recorded as part of the event logMerge Queuehello@mergify.com (Mergify)Skip intermediate resultshttps://docs.mergify.com/changelog/2025-11-12-skip-intermediate-results/https://docs.mergify.com/changelog/2025-11-12-skip-intermediate-results/Allows merging a PR early if a later batch including it passes all checks and conditions.Wed, 12 Nov 2025 00:00:00 GMTAllows merging a PR early if a later batch including it passes all checks and conditions.Merge Queuehello@mergify.com (Mergify)New changeloghttps://docs.mergify.com/changelog/2025-11-07-new-changelog/https://docs.mergify.com/changelog/2025-11-07-new-changelog/New unified changelog experience 🚀Fri, 07 Nov 2025 00:00:00 GMTNew unified changelog experience 🚀hello@mergify.com (Mergify)New statistics page visualshttps://docs.mergify.com/changelog/2025-11-06-new-statistics-page-visuals/https://docs.mergify.com/changelog/2025-11-06-new-statistics-page-visuals/We upgraded the looks of the statistics page, including better charts and tooltips visuals.Thu, 06 Nov 2025 00:00:00 GMTWe upgraded the looks of the statistics page, including better charts and tooltips visuals.Merge Queuehello@mergify.com (Mergify)New \`glob\` operator for conditions in the configurationhttps://docs.mergify.com/changelog/2025-10-31-new-glob-operator-for-conditions-in-the-configuration/https://docs.mergify.com/changelog/2025-10-31-new-glob-operator-for-conditions-in-the-configuration/Adds the \`\*=\` operator for glob-style pattern matching in conditionsFri, 31 Oct 2025 00:00:00 GMTAdds the \`\*=\` operator for glob-style pattern matching in conditionsRuleshello@mergify.com (Mergify)Unsuccessful checks are displayed on checks eventhttps://docs.mergify.com/changelog/2025-10-29-unsuccessful-checks-are-displayed-on-checks-event/https://docs.mergify.com/changelog/2025-10-29-unsuccessful-checks-are-displayed-on-checks-event/Better way to find unsuccessful checksWed, 29 Oct 2025 00:00:00 GMTBetter way to find unsuccessful checksMerge Queuehello@mergify.com (Mergify)New Queue Resets & Batch Interruptions charthttps://docs.mergify.com/changelog/2025-10-27-new-queue-resets-batch-interruptions-chart/https://docs.mergify.com/changelog/2025-10-27-new-queue-resets-batch-interruptions-chart/New dedicated chart to track errors and problems in the merge queue, including failed checks, timeouts, queue resets, and batch failures.Mon, 27 Oct 2025 00:00:00 GMTNew dedicated chart to track errors and problems in the merge queue, including failed checks, timeouts, queue resets, and batch failures.Merge Queuehello@mergify.com (Mergify)Dequeued label on PRhttps://docs.mergify.com/changelog/2025-10-20-dequeued-label-on-pr/https://docs.mergify.com/changelog/2025-10-20-dequeued-label-on-pr/New label for identifying dequeued pull requestsMon, 20 Oct 2025 00:00:00 GMTNew label for identifying dequeued pull requestsMerge Queuehello@mergify.com (Mergify)\`allow\_inplace\_checks\` has been deprecatedhttps://docs.mergify.com/changelog/2025-09-30-allow-inplace-checks-has-been-deprecated/https://docs.mergify.com/changelog/2025-09-30-allow-inplace-checks-has-been-deprecated/\`allow\_inplace\_checks\` is deprecated — checks are now placed automatically based on \`batch\_size\`, \`merge\_conditions\`, and \`max\_parallel\_checks\`.Tue, 30 Sep 2025 00:00:00 GMT\`allow\_inplace\_checks\` is deprecated — checks are now placed automatically based on \`batch\_size\`, \`merge\_conditions\`, and \`max\_parallel\_checks\`.DeprecationsMerge Queuehello@mergify.com (Mergify)Add/remove \`queued\` label automatically on PRshttps://docs.mergify.com/changelog/2025-09-24-addremove-queued-label-automatically-on-prs/https://docs.mergify.com/changelog/2025-09-24-addremove-queued-label-automatically-on-prs/New \`queued\_label\` option on \`merge\_queue\` automatically tags pull requests as they enter and leave the queue.Wed, 24 Sep 2025 00:00:00 GMTNew \`queued\_label\` option on \`merge\_queue\` automatically tags pull requests as they enter and leave the queue.Merge Queuehello@mergify.com (Mergify)Custom column display in CI Insightshttps://docs.mergify.com/changelog/2025-09-16-custom-column-display-in-ci-insights/https://docs.mergify.com/changelog/2025-09-16-custom-column-display-in-ci-insights/Toggle column visibility in CI Insights tables — preferences persist locally and travel with the URL when shared.Tue, 16 Sep 2025 00:00:00 GMTToggle column visibility in CI Insights tables — preferences persist locally and travel with the URL when shared.CI Insightshello@mergify.com (Mergify)Test failure details in PR commentshttps://docs.mergify.com/changelog/2025-09-04-test-failure-details-in-pr-comments/https://docs.mergify.com/changelog/2025-09-04-test-failure-details-in-pr-comments/CI Insights PR comments now include test-level details: failed tests, flaky test history, and links to investigate further.Thu, 04 Sep 2025 00:00:00 GMTCI Insights PR comments now include test-level details: failed tests, flaky test history, and links to investigate further.CI Insightshello@mergify.com (Mergify)Validate your configuration locally with a pre-commit hookhttps://docs.mergify.com/changelog/2025-09-01-validate-your-configuration-locally-with-a-pre-commit-hook/https://docs.mergify.com/changelog/2025-09-01-validate-your-configuration-locally-with-a-pre-commit-hook/Mergify's official pre-commit hook validates your configuration locally before you push.Mon, 01 Sep 2025 00:00:00 GMTMergify's official pre-commit hook validates your configuration locally before you push.Ruleshello@mergify.com (Mergify)Autoqueue option for queue ruleshttps://docs.mergify.com/changelog/2025-08-19-autoqueue-option-for-queue-rules/https://docs.mergify.com/changelog/2025-08-19-autoqueue-option-for-queue-rules/New \`autoqueue\` field on \`queue\_rules\` automatically queues matching pull requests, removing the need for explicit \`queue\` actions.Tue, 19 Aug 2025 00:00:00 GMTNew \`autoqueue\` field on \`queue\_rules\` automatically queues matching pull requests, removing the need for explicit \`queue\` actions.Merge Queuehello@mergify.com (Mergify)CI Insights PR reporthttps://docs.mergify.com/changelog/2025-07-31-ci-insights-pr-report/https://docs.mergify.com/changelog/2025-07-31-ci-insights-pr-report/CI Insights now posts a summary comment on every pull request — failed jobs, flaky tests, execution time, and CI health at a glance.Thu, 31 Jul 2025 00:00:00 GMTCI Insights now posts a summary comment on every pull request — failed jobs, flaky tests, execution time, and CI health at a glance.CI Insightshello@mergify.com (Mergify)Partition rules are now deprecatedhttps://docs.mergify.com/changelog/2025-07-28-partition-rules-are-now-deprecated/https://docs.mergify.com/changelog/2025-07-28-partition-rules-are-now-deprecated/\`partition\_rules\` is deprecated — use \`queue\_rules\` instead. Existing configurations are being upgraded.Mon, 28 Jul 2025 00:00:00 GMT\`partition\_rules\` is deprecated — use \`queue\_rules\` instead. Existing configurations are being upgraded.Merge Queuehello@mergify.com (Mergify)Allow to disable comment postinghttps://docs.mergify.com/changelog/2025-07-18-allow-to-disable-comment-posting/https://docs.mergify.com/changelog/2025-07-18-allow-to-disable-comment-posting/New configuration option enables or disables the comment posted by Merge Protections.Fri, 18 Jul 2025 00:00:00 GMTNew configuration option enables or disables the comment posted by Merge Protections.Merge Protectionshello@mergify.com (Mergify)Remove deprecated implicit priority between queue ruleshttps://docs.mergify.com/changelog/2025-06-30-remove-deprecated-implicit-priority-between-queue-rules/https://docs.mergify.com/changelog/2025-06-30-remove-deprecated-implicit-priority-between-queue-rules/Implicit ordering by queue-rule definition is gone — use \`priority\_rules\` to control merge order.Mon, 30 Jun 2025 00:00:00 GMTImplicit ordering by queue-rule definition is gone — use \`priority\_rules\` to control merge order.Merge Queuehello@mergify.com (Mergify)Remove deprecated options of \`queue\` actionhttps://docs.mergify.com/changelog/2025-06-24-remove-deprecated-options-of-queue-action/https://docs.mergify.com/changelog/2025-06-24-remove-deprecated-options-of-queue-action/The deprecated options of the \`queue\` action have been removed.Tue, 24 Jun 2025 00:00:00 GMTThe deprecated options of the \`queue\` action have been removed.Merge QueueWorkflow Automationhello@mergify.com (Mergify)\`max\_parallel\_checks\` is now 5 by defaulthttps://docs.mergify.com/changelog/2025-06-02-max-parallel-checks-is-now-5-by-default/https://docs.mergify.com/changelog/2025-06-02-max-parallel-checks-is-now-5-by-default/\`max\_parallel\_checks\` now defaults to 5, reducing merge latency without overusing CI resources.Mon, 02 Jun 2025 00:00:00 GMT\`max\_parallel\_checks\` now defaults to 5, reducing merge latency without overusing CI resources.Merge Queuehello@mergify.com (Mergify)\`GET /products/{owner}\` endpoint has been removedhttps://docs.mergify.com/changelog/2025-05-26-get-productsowner-endpoint-has-been-removed/https://docs.mergify.com/changelog/2025-05-26-get-productsowner-endpoint-has-been-removed/The \`GET /products/{owner}\` endpoint is replaced by \`GET /repos/{owner}\`, which returns more data.Mon, 26 May 2025 00:00:00 GMTThe \`GET /products/{owner}\` endpoint is replaced by \`GET /repos/{owner}\`, which returns more data.APIhello@mergify.com (Mergify)Add deployment success/failure to conditionshttps://docs.mergify.com/changelog/2025-03-31-add-deployment-successfailure-to-conditions/https://docs.mergify.com/changelog/2025-03-31-add-deployment-successfailure-to-conditions/New \`deployment-success\` and \`deployment-failure\` conditions list a pull request's deployments and their outcome.Mon, 31 Mar 2025 00:00:00 GMTNew \`deployment-success\` and \`deployment-failure\` conditions list a pull request's deployments and their outcome.Ruleshello@mergify.com (Mergify)Autosquash disabled by default for the \`queue\` actionhttps://docs.mergify.com/changelog/2025-03-14-autosquash-disabled-by-default-for-the-queue-action/https://docs.mergify.com/changelog/2025-03-14-autosquash-disabled-by-default-for-the-queue-action/\`autosquash\` is now off by default for the \`queue\` action, so Mergify can rebase without impersonating the author.Fri, 14 Mar 2025 00:00:00 GMT\`autosquash\` is now off by default for the \`queue\` action, so Mergify can rebase without impersonating the author.Workflow AutomationMerge Queuehello@mergify.com (Mergify)Statistics by priorityhttps://docs.mergify.com/changelog/2025-03-11-statistics-by-priority/https://docs.mergify.com/changelog/2025-03-11-statistics-by-priority/Merge Queue statistics are now broken down by pull request priority.Tue, 11 Mar 2025 00:00:00 GMTMerge Queue statistics are now broken down by pull request priority.Merge Queuehello@mergify.com (Mergify)Datadog scheduled freeze metricshttps://docs.mergify.com/changelog/2025-03-03-datadog-scheduled-freeze-metrics/https://docs.mergify.com/changelog/2025-03-03-datadog-scheduled-freeze-metrics/The Datadog integration now sends a metric for the number of ongoing scheduled freezes.Mon, 03 Mar 2025 00:00:00 GMTThe Datadog integration now sends a metric for the number of ongoing scheduled freezes.Integrationshello@mergify.com (Mergify)\`disallow\_checks\_interruption\_from\_queues\` has been deprecatedhttps://docs.mergify.com/changelog/2025-02-25-disallow-checks-interruption-from-queues-has-been-deprecated/https://docs.mergify.com/changelog/2025-02-25-disallow-checks-interruption-from-queues-has-been-deprecated/The \`disallow\_checks\_interruption\_from\_queues\` option has been removed — use \`priority\_rules\` instead.Tue, 25 Feb 2025 00:00:00 GMTThe \`disallow\_checks\_interruption\_from\_queues\` option has been removed — use \`priority\_rules\` instead.Merge Queuehello@mergify.com (Mergify)Removal of queue freeze attributeshttps://docs.mergify.com/changelog/2025-02-25-removal-of-queue-freeze-attributes/https://docs.mergify.com/changelog/2025-02-25-removal-of-queue-freeze-attributes/The \`queue-freeze\` and \`queue-freeze-reason\` pull request attributes have been removed.Tue, 25 Feb 2025 00:00:00 GMTThe \`queue-freeze\` and \`queue-freeze-reason\` pull request attributes have been removed.Deprecationshello@mergify.com (Mergify)Average batch size statshttps://docs.mergify.com/changelog/2025-02-19-average-batch-size-stats/https://docs.mergify.com/changelog/2025-02-19-average-batch-size-stats/New API endpoint and dashboard chart expose average batch size statistics for your merge queue.Wed, 19 Feb 2025 00:00:00 GMTNew API endpoint and dashboard chart expose average batch size statistics for your merge queue.APIMerge Queuehello@mergify.com (Mergify)\`priority\_rules\` from \`queue\_rules\` removalhttps://docs.mergify.com/changelog/2025-02-18-priority-rules-from-queue-rules-removal/https://docs.mergify.com/changelog/2025-02-18-priority-rules-from-queue-rules-removal/The deprecated \`priority\_rules\` section under \`queue\_rules\` has been removed — it's now top-level.Tue, 18 Feb 2025 00:00:00 GMTThe deprecated \`priority\_rules\` section under \`queue\_rules\` has been removed — it's now top-level.Merge Queuehello@mergify.com (Mergify)Deprecated \`autoquash\` option removalhttps://docs.mergify.com/changelog/2025-02-14-deprecated-autoquash-option-removal/https://docs.mergify.com/changelog/2025-02-14-deprecated-autoquash-option-removal/The deprecated \`autosquash\` option has been removed from the \`queue\` action — set it under \`queue\_rules\` instead.Fri, 14 Feb 2025 00:00:00 GMTThe deprecated \`autosquash\` option has been removed from the \`queue\` action — set it under \`queue\_rules\` instead.Merge QueueRuleshello@mergify.com (Mergify)Remove deprecated \`allow\_checks\_interruption\`https://docs.mergify.com/changelog/2025-02-14-remove-deprecated-allow-checks-interruption/https://docs.mergify.com/changelog/2025-02-14-remove-deprecated-allow-checks-interruption/The deprecated \`allow\_checks\_interruption\` option has been removed.Fri, 14 Feb 2025 00:00:00 GMTThe deprecated \`allow\_checks\_interruption\` option has been removed.Merge Queuehello@mergify.com (Mergify)Remove deprecated \`allow\_merging\_configuration\_change\` optionhttps://docs.mergify.com/changelog/2025-02-14-remove-deprecated-allow-merging-configuration-change-option/https://docs.mergify.com/changelog/2025-02-14-remove-deprecated-allow-merging-configuration-change-option/The deprecated \`allow\_merging\_configuration\_change\` option has been removed — it had been a no-op for the past year.Fri, 14 Feb 2025 00:00:00 GMTThe deprecated \`allow\_merging\_configuration\_change\` option has been removed — it had been a no-op for the past year.Workflow Automationhello@mergify.com (Mergify)Scheduled freezes support in Slackhttps://docs.mergify.com/changelog/2025-01-31-scheduled-freezes-support-in-slack/https://docs.mergify.com/changelog/2025-01-31-scheduled-freezes-support-in-slack/Send scheduled freeze creation, update, and deletion events from Merge Protections directly to a Slack channel.Fri, 31 Jan 2025 00:00:00 GMTSend scheduled freeze creation, update, and deletion events from Merge Protections directly to a Slack channel.IntegrationsMerge Protectionshello@mergify.com (Mergify)Merge Queue Freeze API is deprecatedhttps://docs.mergify.com/changelog/2024-11-21-merge-queue-freeze-api-is-deprecated/https://docs.mergify.com/changelog/2024-11-21-merge-queue-freeze-api-is-deprecated/The Freeze API is replaced by the Pause API, which adds \`allow\_checks\_to\_run\` to mimic the previous behavior.Thu, 21 Nov 2024 00:00:00 GMTThe Freeze API is replaced by the Pause API, which adds \`allow\_checks\_to\_run\` to mimic the previous behavior.Merge Queuehello@mergify.com (Mergify)New \`updates\` attribute available for conditionshttps://docs.mergify.com/changelog/2024-11-21-new-updates-attribute-available-for-conditions/https://docs.mergify.com/changelog/2024-11-21-new-updates-attribute-available-for-conditions/New \`updates\` attribute exposes the list of updates pushed to a pull request's branch, usable in conditions.Thu, 21 Nov 2024 00:00:00 GMTNew \`updates\` attribute exposes the list of updates pushed to a pull request's branch, usable in conditions.Ruleshello@mergify.com (Mergify)Slack integrationhttps://docs.mergify.com/changelog/2024-11-14-slack-integration/https://docs.mergify.com/changelog/2024-11-14-slack-integration/Mergify integrates natively with Slack — send your merge queue activity to any channel.Thu, 14 Nov 2024 00:00:00 GMTMergify integrates natively with Slack — send your merge queue activity to any channel.Integrationshello@mergify.com (Mergify)Merge Protections reports pending eventshttps://docs.mergify.com/changelog/2024-11-07-merge-protections-reports-pending-events/https://docs.mergify.com/changelog/2024-11-07-merge-protections-reports-pending-events/Merge protections with pending conditions (running CI, schedules) now report as pending instead of failing.Thu, 07 Nov 2024 00:00:00 GMTMerge protections with pending conditions (running CI, schedules) now report as pending instead of failing.Merge Protectionshello@mergify.com (Mergify)Datadog integrationhttps://docs.mergify.com/changelog/2024-11-04-datadog-integration/https://docs.mergify.com/changelog/2024-11-04-datadog-integration/New agent-less Datadog integration sends merge queue metrics straight from Mergify — enable it from your dashboard.Mon, 04 Nov 2024 00:00:00 GMTNew agent-less Datadog integration sends merge queue metrics straight from Mergify — enable it from your dashboard.Integrationshello@mergify.com (Mergify)Add \`max\_parallel\_checks\`https://docs.mergify.com/changelog/2024-09-23-add-max-parallel-checks/https://docs.mergify.com/changelog/2024-09-23-add-max-parallel-checks/New \`max\_parallel\_checks\` option for \`merge\_queue\` controls parallel checks and replaces the deprecated \`speculative\_checks\`.Mon, 23 Sep 2024 00:00:00 GMTNew \`max\_parallel\_checks\` option for \`merge\_queue\` controls parallel checks and replaces the deprecated \`speculative\_checks\`.Merge Queuehello@mergify.com (Mergify)Add allow\_checks\_interruption option in priority\_rules sectionhttps://docs.mergify.com/changelog/2024-09-13-add-allow-checks-interruption-option-in-priority-rules-section/https://docs.mergify.com/changelog/2024-09-13-add-allow-checks-interruption-option-in-priority-rules-section/Priority rules now support \`allow\_checks\_interruption\`, letting higher-priority PRs interrupt running checks.Fri, 13 Sep 2024 00:00:00 GMTPriority rules now support \`allow\_checks\_interruption\`, letting higher-priority PRs interrupt running checks.Merge Queuehello@mergify.com (Mergify)Allow to have \`queue\_rule\` in \`defaults\` sectionhttps://docs.mergify.com/changelog/2024-09-06-allow-to-have-queue-rule-in-defaults-section/https://docs.mergify.com/changelog/2024-09-06-allow-to-have-queue-rule-in-defaults-section/Set defaults for queue rules — including \`bot\_account\` and \`batch\_size\` — via the \`defaults\` section, including across extended configurations.Fri, 06 Sep 2024 00:00:00 GMTSet defaults for queue rules — including \`bot\_account\` and \`batch\_size\` — via the \`defaults\` section, including across extended configurations.Merge Queuehello@mergify.com (Mergify)Priority\_rules is now at the top level of the Mergify confighttps://docs.mergify.com/changelog/2024-08-26-priority-rules-is-now-at-the-top-level-of-the-mergify-config/https://docs.mergify.com/changelog/2024-08-26-priority-rules-is-now-at-the-top-level-of-the-mergify-config/\`priority\_rules\` is now a top-level option, with priorities applied globally across the merge queue.Mon, 26 Aug 2024 00:00:00 GMT\`priority\_rules\` is now a top-level option, with priorities applied globally across the merge queue.Merge Queuehello@mergify.com (Mergify)Queue action options deprecationhttps://docs.mergify.com/changelog/2024-07-26-queue-action-options-deprecation/https://docs.mergify.com/changelog/2024-07-26-queue-action-options-deprecation/All \`queue\` action options are deprecated — configure them under \`queue\_rules\` instead.Fri, 26 Jul 2024 00:00:00 GMTAll \`queue\` action options are deprecated — configure them under \`queue\_rules\` instead.Workflow Automationhello@mergify.com (Mergify)Allow to specify merge\_conflict\_style for copy and backport actionshttps://docs.mergify.com/changelog/2024-05-28-allow-to-specify-merge-conflict-style-for-copy-and-backport-actions/https://docs.mergify.com/changelog/2024-05-28-allow-to-specify-merge-conflict-style-for-copy-and-backport-actions/Set \`merge\_conflict\_style: diff3\` on \`copy\` and \`backport\` to use the diff3 style for conflict markers.Tue, 28 May 2024 00:00:00 GMTSet \`merge\_conflict\_style: diff3\` on \`copy\` and \`backport\` to use the diff3 style for conflict markers.Workflow Automationhello@mergify.com (Mergify)Add merge-commit-sha attributehttps://docs.mergify.com/changelog/2024-05-14-add-merge-commit-sha-attribute/https://docs.mergify.com/changelog/2024-05-14-add-merge-commit-sha-attribute/New \`merge-commit-sha\` attribute exposes a pull request's merge commit SHA1 in rules and templates.Tue, 14 May 2024 00:00:00 GMTNew \`merge-commit-sha\` attribute exposes a pull request's merge commit SHA1 in rules and templates.Ruleshello@mergify.com (Mergify)Expose the number of added/deleted/modified lineshttps://docs.mergify.com/changelog/2024-03-13-expose-the-number-of-addeddeletedmodified-lines/https://docs.mergify.com/changelog/2024-03-13-expose-the-number-of-addeddeletedmodified-lines/New \`#added-lines\`, \`#deleted-lines\`, and \`#modified-lines\` attributes expose line-change counts in conditions and templates.Wed, 13 Mar 2024 00:00:00 GMTNew \`#added-lines\`, \`#deleted-lines\`, and \`#modified-lines\` attributes expose line-change counts in conditions and templates.Ruleshello@mergify.com (Mergify)Add merge queue total queue timehttps://docs.mergify.com/changelog/2024-03-06-add-merge-queue-total-queue-time/https://docs.mergify.com/changelog/2024-03-06-add-merge-queue-total-queue-time/New API endpoint exposes the total queue time for pull requests, also surfaced in the dashboard statistics.Wed, 06 Mar 2024 00:00:00 GMTNew API endpoint exposes the total queue time for pull requests, also surfaced in the dashboard statistics.APIMerge Queuehello@mergify.com (Mergify)Add support for \`description\` key in \`pull\_request\_rules\`https://docs.mergify.com/changelog/2024-03-01-add-support-for-description-key-in-pull-request-rules/https://docs.mergify.com/changelog/2024-03-01-add-support-for-description-key-in-pull-request-rules/New \`description\` key documents what each pull request rule does.Fri, 01 Mar 2024 00:00:00 GMTNew \`description\` key documents what each pull request rule does.Ruleshello@mergify.com (Mergify)Add copy/backport action "report\_mode" optionhttps://docs.mergify.com/changelog/2024-02-29-add-copybackport-action-report-mode-option/https://docs.mergify.com/changelog/2024-02-29-add-copybackport-action-report-mode-option/New \`report\_mode\` parameter lets you report \`copy\` and \`backport\` results as a GitHub check or as a comment.Thu, 29 Feb 2024 00:00:00 GMTNew \`report\_mode\` parameter lets you report \`copy\` and \`backport\` results as a GitHub check or as a comment.Workflow Automationhello@mergify.com (Mergify)Copy/backport actions post comment with cherry-pick errorhttps://docs.mergify.com/changelog/2024-02-27-copybackport-actions-post-comment-with-cherry-pick-error/https://docs.mergify.com/changelog/2024-02-27-copybackport-actions-post-comment-with-cherry-pick-error/When \`copy\` or \`backport\` fails to cherry-pick, Mergify now posts the error as a comment on the target pull request.Tue, 27 Feb 2024 00:00:00 GMTWhen \`copy\` or \`backport\` fails to cherry-pick, Mergify now posts the error as a comment on the target pull request.Workflow Automationhello@mergify.com (Mergify)\`allow\_merging\_configuration\_change\` option is deprecatedhttps://docs.mergify.com/changelog/2024-01-26-allow-merging-configuration-change-option-is-deprecated/https://docs.mergify.com/changelog/2024-01-26-allow-merging-configuration-change-option-is-deprecated/Use \`-mergify-configuration-changed\` in your conditions instead — \`allow\_merging\_configuration\_change\` is deprecated.Fri, 26 Jan 2024 00:00:00 GMTUse \`-mergify-configuration-changed\` in your conditions instead — \`allow\_merging\_configuration\_change\` is deprecated.Workflow Automationhello@mergify.com (Mergify)Add new endpoint for queue checks outcomehttps://docs.mergify.com/changelog/2024-01-24-add-new-endpoint-for-queue-checks-outcome/https://docs.mergify.com/changelog/2024-01-24-add-new-endpoint-for-queue-checks-outcome/New API endpoint exposes statistics on queue checks outcome, replacing the previous endpoint.Wed, 24 Jan 2024 00:00:00 GMTNew API endpoint exposes statistics on queue checks outcome, replacing the previous endpoint.APIMerge Queuehello@mergify.com (Mergify)Stats endpoints for the number of running checkshttps://docs.mergify.com/changelog/2024-01-23-stats-endpoints-for-the-number-of-running-checks/https://docs.mergify.com/changelog/2024-01-23-stats-endpoints-for-the-number-of-running-checks/New statistics endpoint exposes the number of concurrent running checks.Tue, 23 Jan 2024 00:00:00 GMTNew statistics endpoint exposes the number of concurrent running checks.APIMerge Queuehello@mergify.com (Mergify)Add mergify-configuration-changed conditionhttps://docs.mergify.com/changelog/2024-01-16-add-mergify-configuration-changed-condition/https://docs.mergify.com/changelog/2024-01-16-add-mergify-configuration-changed-condition/New boolean condition \`mergify-configuration-changed\` is true when a pull request modifies the Mergify configuration.Tue, 16 Jan 2024 00:00:00 GMTNew boolean condition \`mergify-configuration-changed\` is true when a pull request modifies the Mergify configuration.Ruleshello@mergify.com (Mergify)API endpoint for average/min/max queue sizehttps://docs.mergify.com/changelog/2024-01-04-api-endpoint-for-averageminmax-queue-size/https://docs.mergify.com/changelog/2024-01-04-api-endpoint-for-averageminmax-queue-size/New API endpoint exposes the average, minimum, and maximum size of your merge queues over recent weeks.Thu, 04 Jan 2024 00:00:00 GMTNew API endpoint exposes the average, minimum, and maximum size of your merge queues over recent weeks.APIMerge Queuehello@mergify.com (Mergify)New API stats endpoint for average idle queue timehttps://docs.mergify.com/changelog/2023-12-22-new-api-stats-endpoint-for-average-idle-queue-time/https://docs.mergify.com/changelog/2023-12-22-new-api-stats-endpoint-for-average-idle-queue-time/Fri, 22 Dec 2023 00:00:00 GMTAPIMerge Queuehello@mergify.com (Mergify)Add an endpoint with stats average runtimehttps://docs.mergify.com/changelog/2023-12-21-add-an-endpoint-with-stats-average-runtime/https://docs.mergify.com/changelog/2023-12-21-add-an-endpoint-with-stats-average-runtime/Thu, 21 Dec 2023 00:00:00 GMTAPIMerge Queuehello@mergify.com (Mergify)Expose queue-frozen and queue-freeze-reason attributehttps://docs.mergify.com/changelog/2023-12-21-expose-queue-frozen-and-queue-freeze-reason-attribute/https://docs.mergify.com/changelog/2023-12-21-expose-queue-frozen-and-queue-freeze-reason-attribute/Thu, 21 Dec 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)New endpoint queues merged count by time intervalshttps://docs.mergify.com/changelog/2023-12-11-new-endpoint-queues-merged-count-by-time-intervals/https://docs.mergify.com/changelog/2023-12-11-new-endpoint-queues-merged-count-by-time-intervals/Mon, 11 Dec 2023 00:00:00 GMTAPIMerge Queuehello@mergify.com (Mergify)Drop \`require\_branch\_protection\` optionhttps://docs.mergify.com/changelog/2023-11-22-drop-require-branch-protection-option/https://docs.mergify.com/changelog/2023-11-22-drop-require-branch-protection-option/Wed, 22 Nov 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add \`queue-name\` attributehttps://docs.mergify.com/changelog/2023-11-16-add-queue-name-attribute/https://docs.mergify.com/changelog/2023-11-16-add-queue-name-attribute/Thu, 16 Nov 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Rename "unqueue" command to "dequeue"https://docs.mergify.com/changelog/2023-11-13-rename-unqueue-command-to-dequeue/https://docs.mergify.com/changelog/2023-11-13-rename-unqueue-command-to-dequeue/Mon, 13 Nov 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add neutral\_conditions to post check actionhttps://docs.mergify.com/changelog/2023-11-02-add-neutral-conditions-to-post-check-action/https://docs.mergify.com/changelog/2023-11-02-add-neutral-conditions-to-post-check-action/Thu, 02 Nov 2023 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)/events API deprecationhttps://docs.mergify.com/changelog/2023-10-31-events-api-deprecation/https://docs.mergify.com/changelog/2023-10-31-events-api-deprecation/Tue, 31 Oct 2023 00:00:00 GMTDeprecationshello@mergify.com (Mergify)Add attribute \`head-repo-full-name\`https://docs.mergify.com/changelog/2023-10-26-add-attribute-head-repo-full-name/https://docs.mergify.com/changelog/2023-10-26-add-attribute-head-repo-full-name/Thu, 26 Oct 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Autodetect best merge methodhttps://docs.mergify.com/changelog/2023-10-20-autodetect-best-merge-method/https://docs.mergify.com/changelog/2023-10-20-autodetect-best-merge-method/Fri, 20 Oct 2023 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)New unqueue reason for branch update failurehttps://docs.mergify.com/changelog/2023-09-12-new-unqueue-reason-for-branch-update-failure/https://docs.mergify.com/changelog/2023-09-12-new-unqueue-reason-for-branch-update-failure/Tue, 12 Sep 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add unqueue reasons for conflictshttps://docs.mergify.com/changelog/2023-09-11-add-unqueue-reasons-for-conflicts/https://docs.mergify.com/changelog/2023-09-11-add-unqueue-reasons-for-conflicts/Mon, 11 Sep 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add \`branch\_protection\_injection\_mode\` to bypass branch protectionshttps://docs.mergify.com/changelog/2023-09-06-add-branch-protection-injection-mode-to-bypass-branch-protections/https://docs.mergify.com/changelog/2023-09-06-add-branch-protection-injection-mode-to-bypass-branch-protections/Wed, 06 Sep 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add condition queue-dequeue-reasonhttps://docs.mergify.com/changelog/2023-09-01-add-condition-queue-dequeue-reason/https://docs.mergify.com/changelog/2023-09-01-add-condition-queue-dequeue-reason/Fri, 01 Sep 2023 00:00:00 GMTMerge QueueRuleshello@mergify.com (Mergify)New action: github\_actionshttps://docs.mergify.com/changelog/2023-08-25-new-action-github-actions/https://docs.mergify.com/changelog/2023-08-25-new-action-github-actions/Fri, 25 Aug 2023 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)Automatically reembark pull request with requeue commandhttps://docs.mergify.com/changelog/2023-08-22-automatically-reembark-pull-request-with-requeue-command/https://docs.mergify.com/changelog/2023-08-22-automatically-reembark-pull-request-with-requeue-command/Tue, 22 Aug 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add added/modified/removed-files attributeshttps://docs.mergify.com/changelog/2023-08-09-add-addedmodifiedremoved-files-attributes/https://docs.mergify.com/changelog/2023-08-09-add-addedmodifiedremoved-files-attributes/Wed, 09 Aug 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Support unspecified digits for current-datetime attributehttps://docs.mergify.com/changelog/2023-08-04-support-unspecified-digits-for-current-datetime-attribute/https://docs.mergify.com/changelog/2023-08-04-support-unspecified-digits-for-current-datetime-attribute/Fri, 04 Aug 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Move \`require\_branch\_protection\` config option to \`queue\_rules\`https://docs.mergify.com/changelog/2023-07-27-move-require-branch-protection-config-option-to-queue-rules/https://docs.mergify.com/changelog/2023-07-27-move-require-branch-protection-config-option-to-queue-rules/Thu, 27 Jul 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Support timestamp intervalshttps://docs.mergify.com/changelog/2023-07-24-support-timestamp-intervals/https://docs.mergify.com/changelog/2023-07-24-support-timestamp-intervals/Mon, 24 Jul 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Add \`current-datetime\` conditionhttps://docs.mergify.com/changelog/2023-07-20-add-current-datetime-condition/https://docs.mergify.com/changelog/2023-07-20-add-current-datetime-condition/Thu, 20 Jul 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Rename queue action \`method\` option in \`merge\_method\`https://docs.mergify.com/changelog/2023-07-07-rename-queue-action-method-option-in-merge-method/https://docs.mergify.com/changelog/2023-07-07-rename-queue-action-method-option-in-merge-method/Fri, 07 Jul 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add co-authors attributehttps://docs.mergify.com/changelog/2023-07-06-add-co-authors-attribute/https://docs.mergify.com/changelog/2023-07-06-add-co-authors-attribute/Thu, 06 Jul 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Merge Queue Pausehttps://docs.mergify.com/changelog/2023-06-27-merge-queue-pause/https://docs.mergify.com/changelog/2023-06-27-merge-queue-pause/Tue, 27 Jun 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)New Actions read permissionhttps://docs.mergify.com/changelog/2023-05-31-new-actions-read-permission/https://docs.mergify.com/changelog/2023-05-31-new-actions-read-permission/Wed, 31 May 2023 00:00:00 GMTIntegrationshello@mergify.com (Mergify)Remove queue action 'priority' attributehttps://docs.mergify.com/changelog/2023-05-15-remove-queue-action-priority-attribute/https://docs.mergify.com/changelog/2023-05-15-remove-queue-action-priority-attribute/Mon, 15 May 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add new queue\_checks\_outcome endpoint that includes all partitions and queueshttps://docs.mergify.com/changelog/2023-05-11-add-new-queue-checks-outcome-endpoint-that-includes-all-partitions-and-queues/https://docs.mergify.com/changelog/2023-05-11-add-new-queue-checks-outcome-endpoint-that-includes-all-partitions-and-queues/Thu, 11 May 2023 00:00:00 GMTAPIMerge Queuehello@mergify.com (Mergify)Add time\_to\_merge endpoint that has data of all partitions and queueshttps://docs.mergify.com/changelog/2023-05-11-add-time-to-merge-endpoint-that-has-data-of-all-partitions-and-queues/https://docs.mergify.com/changelog/2023-05-11-add-time-to-merge-endpoint-that-has-data-of-all-partitions-and-queues/Thu, 11 May 2023 00:00:00 GMTAPIMerge Queuehello@mergify.com (Mergify)Support Merge-After condition in PR bodyhttps://docs.mergify.com/changelog/2023-04-19-support-merge-after-condition-in-pr-body/https://docs.mergify.com/changelog/2023-04-19-support-merge-after-condition-in-pr-body/Wed, 19 Apr 2023 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)Allow to use autosquash with rebase update methodhttps://docs.mergify.com/changelog/2023-03-31-allow-to-use-autosquash-with-rebase-update-method/https://docs.mergify.com/changelog/2023-03-31-allow-to-use-autosquash-with-rebase-update-method/Fri, 31 Mar 2023 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)Star attribute in commits listhttps://docs.mergify.com/changelog/2023-03-24-star-attribute-in-commits-list/https://docs.mergify.com/changelog/2023-03-24-star-attribute-in-commits-list/Fri, 24 Mar 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Add partition\_ruleshttps://docs.mergify.com/changelog/2023-03-23-add-partition-rules/https://docs.mergify.com/changelog/2023-03-23-add-partition-rules/Thu, 23 Mar 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Drop rebase\_fallback optionhttps://docs.mergify.com/changelog/2023-03-15-drop-rebase-fallback-option/https://docs.mergify.com/changelog/2023-03-15-drop-rebase-fallback-option/Wed, 15 Mar 2023 00:00:00 GMTWorkflow AutomationMerge Queuehello@mergify.com (Mergify)Open draft PR if no bot account is set and rebase is usedhttps://docs.mergify.com/changelog/2023-03-15-open-draft-pr-if-no-bot-account-is-set-and-rebase-is-used/https://docs.mergify.com/changelog/2023-03-15-open-draft-pr-if-no-bot-account-is-set-and-rebase-is-used/Wed, 15 Mar 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add routing\_conditions attribute to queue\_ruleshttps://docs.mergify.com/changelog/2023-02-20-add-routing-conditions-attribute-to-queue-rules/https://docs.mergify.com/changelog/2023-02-20-add-routing-conditions-attribute-to-queue-rules/Mon, 20 Feb 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Allow to merge Mergify configuration automaticallyhttps://docs.mergify.com/changelog/2023-02-20-allow-to-merge-mergify-configuration-automatically/https://docs.mergify.com/changelog/2023-02-20-allow-to-merge-mergify-configuration-automatically/Mon, 20 Feb 2023 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)Priority option for queue is deprecatedhttps://docs.mergify.com/changelog/2023-02-03-priority-option-for-queue-is-deprecated/https://docs.mergify.com/changelog/2023-02-03-priority-option-for-queue-is-deprecated/Fri, 03 Feb 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Rebasing pull requests with a random user is deprecatedhttps://docs.mergify.com/changelog/2023-02-01-rebasing-pull-requests-with-a-random-user-is-deprecated/https://docs.mergify.com/changelog/2023-02-01-rebasing-pull-requests-with-a-random-user-is-deprecated/Wed, 01 Feb 2023 00:00:00 GMTDeprecationshello@mergify.com (Mergify)Add a merge\_conditions to queue\_rules to replace conditionshttps://docs.mergify.com/changelog/2023-01-18-add-a-merge-conditions-to-queue-rules-to-replace-conditions/https://docs.mergify.com/changelog/2023-01-18-add-a-merge-conditions-to-queue-rules-to-replace-conditions/Wed, 18 Jan 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Allow labels value to have template variableshttps://docs.mergify.com/changelog/2023-01-18-allow-labels-value-to-have-template-variables/https://docs.mergify.com/changelog/2023-01-18-allow-labels-value-to-have-template-variables/Wed, 18 Jan 2023 00:00:00 GMTRuleshello@mergify.com (Mergify)Add batch\_max\_failure\_resolution\_attemptshttps://docs.mergify.com/changelog/2023-01-09-add-batch-max-failure-resolution-attempts/https://docs.mergify.com/changelog/2023-01-09-add-batch-max-failure-resolution-attempts/Mon, 09 Jan 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Add priority ruleshttps://docs.mergify.com/changelog/2023-01-06-add-priority-rules/https://docs.mergify.com/changelog/2023-01-06-add-priority-rules/Fri, 06 Jan 2023 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Conditions can access commit detailshttps://docs.mergify.com/changelog/2022-12-15-conditions-can-access-commit-details/https://docs.mergify.com/changelog/2022-12-15-conditions-can-access-commit-details/Thu, 15 Dec 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)Option priority of merge action is deprecatedhttps://docs.mergify.com/changelog/2022-12-15-option-priority-of-merge-action-is-deprecated/https://docs.mergify.com/changelog/2022-12-15-option-priority-of-merge-action-is-deprecated/Thu, 15 Dec 2022 00:00:00 GMTDeprecationshello@mergify.com (Mergify)Default value for rebase\_fallbackhttps://docs.mergify.com/changelog/2022-12-13-default-value-for-rebase-fallback/https://docs.mergify.com/changelog/2022-12-13-default-value-for-rebase-fallback/Tue, 13 Dec 2022 00:00:00 GMTDeprecationshello@mergify.com (Mergify)\`rebase\_fallback\` is deprecatedhttps://docs.mergify.com/changelog/2022-12-07-rebase-fallback-is-deprecated/https://docs.mergify.com/changelog/2022-12-07-rebase-fallback-is-deprecated/Wed, 07 Dec 2022 00:00:00 GMTDeprecationshello@mergify.com (Mergify)Add freeze cascading effect disablinghttps://docs.mergify.com/changelog/2022-12-01-add-freeze-cascading-effect-disabling/https://docs.mergify.com/changelog/2022-12-01-add-freeze-cascading-effect-disabling/Thu, 01 Dec 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)New statistics APIhttps://docs.mergify.com/changelog/2022-11-22-new-statistics-api/https://docs.mergify.com/changelog/2022-11-22-new-statistics-api/Tue, 22 Nov 2022 00:00:00 GMTAPIMerge Queuehello@mergify.com (Mergify)Rebase action autosquash when PR is up-to-datehttps://docs.mergify.com/changelog/2022-11-16-rebase-action-autosquash-when-pr-is-up-to-date/https://docs.mergify.com/changelog/2022-11-16-rebase-action-autosquash-when-pr-is-up-to-date/Wed, 16 Nov 2022 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)New toggle option for the \`label\` actionhttps://docs.mergify.com/changelog/2022-11-15-new-toggle-option-for-the-label-action/https://docs.mergify.com/changelog/2022-11-15-new-toggle-option-for-the-label-action/Tue, 15 Nov 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)Deprecation of current-\* conditionshttps://docs.mergify.com/changelog/2022-11-14-deprecation-of-current-conditions/https://docs.mergify.com/changelog/2022-11-14-deprecation-of-current-conditions/Mon, 14 Nov 2022 00:00:00 GMTRulesDeprecationshello@mergify.com (Mergify)Improve branch protection compatibilityhttps://docs.mergify.com/changelog/2022-10-26-improve-branch-protection-compatibility/https://docs.mergify.com/changelog/2022-10-26-improve-branch-protection-compatibility/Wed, 26 Oct 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Queue statistics dashboardhttps://docs.mergify.com/changelog/2022-10-14-queue-statistics-dashboard/https://docs.mergify.com/changelog/2022-10-14-queue-statistics-dashboard/Fri, 14 Oct 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Allow templating in conditionshttps://docs.mergify.com/changelog/2022-10-10-allow-templating-in-conditions/https://docs.mergify.com/changelog/2022-10-10-allow-templating-in-conditions/Mon, 10 Oct 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)\`branch-protection-review-decision\` boolean conditionshttps://docs.mergify.com/changelog/2022-10-06-branch-protection-review-decision-boolean-conditions/https://docs.mergify.com/changelog/2022-10-06-branch-protection-review-decision-boolean-conditions/Thu, 06 Oct 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)Allow to extend configurationhttps://docs.mergify.com/changelog/2022-09-21-allow-to-extend-configuration/https://docs.mergify.com/changelog/2022-09-21-allow-to-extend-configuration/Wed, 21 Sep 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)Queue branch merge methodhttps://docs.mergify.com/changelog/2022-09-09-queue-branch-merge-method/https://docs.mergify.com/changelog/2022-09-09-queue-branch-merge-method/Fri, 09 Sep 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Event logs availabilityhttps://docs.mergify.com/changelog/2022-09-07-event-logs-availability/https://docs.mergify.com/changelog/2022-09-07-event-logs-availability/Wed, 07 Sep 2022 00:00:00 GMTAPIMerge QueueWorkflow Automationhello@mergify.com (Mergify)Allow queue branch editionhttps://docs.mergify.com/changelog/2022-09-02-allow-queue-branch-edition/https://docs.mergify.com/changelog/2022-09-02-allow-queue-branch-edition/Fri, 02 Sep 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Commands restrictionshttps://docs.mergify.com/changelog/2022-08-24-commands-restrictions/https://docs.mergify.com/changelog/2022-08-24-commands-restrictions/Wed, 24 Aug 2022 00:00:00 GMTRulesWorkflow Automationhello@mergify.com (Mergify)New dependabot attributeshttps://docs.mergify.com/changelog/2022-08-01-new-dependabot-attributes/https://docs.mergify.com/changelog/2022-08-01-new-dependabot-attributes/Mon, 01 Aug 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)New queue commandhttps://docs.mergify.com/changelog/2022-08-01-new-queue-command/https://docs.mergify.com/changelog/2022-08-01-new-queue-command/Mon, 01 Aug 2022 00:00:00 GMTWorkflow Automationhello@mergify.com (Mergify)New shared configuration supporthttps://docs.mergify.com/changelog/2022-07-20-new-shared-configuration-support/https://docs.mergify.com/changelog/2022-07-20-new-shared-configuration-support/Wed, 20 Jul 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)Queue branch prefix is now configurablehttps://docs.mergify.com/changelog/2022-07-20-queue-branch-prefix-is-now-configurable/https://docs.mergify.com/changelog/2022-07-20-queue-branch-prefix-is-now-configurable/Wed, 20 Jul 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)\`allow\_inplace\_checks\` changeshttps://docs.mergify.com/changelog/2022-05-13-allow-inplace-checks-changes/https://docs.mergify.com/changelog/2022-05-13-allow-inplace-checks-changes/Fri, 13 May 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)\`commits-behind\` changehttps://docs.mergify.com/changelog/2022-04-29-commits-behind-change/https://docs.mergify.com/changelog/2022-04-29-commits-behind-change/Fri, 29 Apr 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)\`commit\_message\` removedhttps://docs.mergify.com/changelog/2022-04-25-commit-message-removed/https://docs.mergify.com/changelog/2022-04-25-commit-message-removed/Mon, 25 Apr 2022 00:00:00 GMTWorkflow AutomationDeprecationshello@mergify.com (Mergify)API configuration validation endpointhttps://docs.mergify.com/changelog/2022-04-22-api-configuration-validation-endpoint/https://docs.mergify.com/changelog/2022-04-22-api-configuration-validation-endpoint/Fri, 22 Apr 2022 00:00:00 GMTDeprecationsAPIhello@mergify.com (Mergify)\`fast-forward\` merge methodhttps://docs.mergify.com/changelog/2022-04-22-fast-forward-merge-method/https://docs.mergify.com/changelog/2022-04-22-fast-forward-merge-method/Fri, 22 Apr 2022 00:00:00 GMTWorkflow AutomationMerge Queuehello@mergify.com (Mergify)\`requeue\` and \`unqueue\` commandshttps://docs.mergify.com/changelog/2022-03-23-requeue-and-unqueue-commands/https://docs.mergify.com/changelog/2022-03-23-requeue-and-unqueue-commands/Wed, 23 Mar 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)Queue freeze featurehttps://docs.mergify.com/changelog/2022-03-16-queue-freeze-feature/https://docs.mergify.com/changelog/2022-03-16-queue-freeze-feature/Wed, 16 Mar 2022 00:00:00 GMTAPIMerge Queuehello@mergify.com (Mergify)New option disallow\_checks\_interruption\_from\_queuehttps://docs.mergify.com/changelog/2022-03-08-new-option-disallow-checks-interruption-from-queue/https://docs.mergify.com/changelog/2022-03-08-new-option-disallow-checks-interruption-from-queue/Tue, 08 Mar 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify)\`repository-name\` and \`repository-full-name\`https://docs.mergify.com/changelog/2022-02-16-repository-name-and-repository-full-name/https://docs.mergify.com/changelog/2022-02-16-repository-name-and-repository-full-name/Wed, 16 Feb 2022 00:00:00 GMTRuleshello@mergify.com (Mergify)Add draft\_bot\_accounthttps://docs.mergify.com/changelog/2022-02-07-add-draft-bot-account/https://docs.mergify.com/changelog/2022-02-07-add-draft-bot-account/Mon, 07 Feb 2022 00:00:00 GMTMerge QueueWorkflow Automationhello@mergify.com (Mergify)\`strict\` mode removedhttps://docs.mergify.com/changelog/2022-01-12-strict-mode-removed/https://docs.mergify.com/changelog/2022-01-12-strict-mode-removed/Wed, 12 Jan 2022 00:00:00 GMTWorkflow AutomationDeprecationshello@mergify.com (Mergify)\`batch\_max\_wait\_time\` defaults to 30shttps://docs.mergify.com/changelog/2022-01-06-batch-max-wait-time-defaults-to-30s/https://docs.mergify.com/changelog/2022-01-06-batch-max-wait-time-defaults-to-30s/Thu, 06 Jan 2022 00:00:00 GMTWorkflow AutomationMerge Queuehello@mergify.com (Mergify)New option batch\_max\_wait\_timehttps://docs.mergify.com/changelog/2022-01-05-new-option-batch-max-wait-time/https://docs.mergify.com/changelog/2022-01-05-new-option-batch-max-wait-time/Wed, 05 Jan 2022 00:00:00 GMTMerge Queuehello@mergify.com (Mergify) --- # Unknown \--- title: Squash description: Squash commits in the pull request. --- The \`squash\` action instructs Mergify to squash all commits from a pull request into one. When you add this action to a rule, Mergify will squash all the commits from the pull request into one commit, making the history of your project cleaner and easier to read. Squashing writes the pull request's head branch, so the \[restrictions on writing a fork's branch\](/workflow/actions/update#fork-pull-requests) apply here too. ## Impersonation Squashing force-pushes the head branch, and Mergify does that as a GitHub user rather than as itself. With no \[\`bot\_account\`\](/configuration/data-types#bot-account) set, that user is the pull request author, or whoever posted the \[\`@mergifyio squash\` command\](/commands/squash) when a command triggered the squash. The account must have signed in to the \[Mergify dashboard\](https://dashboard.mergify.com) at least once. That account cannot be a bot: Mergify cannot impersonate an account owned by another GitHub App. The action fails whenever the account it falls back to is one, whether a GitHub App opened the pull request, such as a dependency update bot, or posted the command. Set \`bot\_account\` to a user account to squash those. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to squash a pull request. If no \`bot\_account\` is set, Mergify picks the pull request author, or the user who sent the \`@mergifyio squash\` command. The user account must have already been logged in Mergify dashboard once. \*\*Warning:\*\* Because of GitHub's security restrictions, Mergify cannot impersonate an account owned by another GitHub App. A squash therefore fails whenever the account it falls back to is a bot, either because the pull request was opened by one or because one sent the command, unless \`bot\_account\` names a user account. | | \`commit\_message\` | \`all-commits\` or \`first-commit\` or \`title+body\` | \`"all-commits"\` | Defines the default commit message to use for the squashed commit. Possible values are: - \`all-commits\` to use the same format as GitHub squashed merge commit. - \`first-commit\` to use the message of the first commit of the pull request. - \`title+body\` means to use the title and body from the pull request itself as the commit message. The pull request number will be added to end of the title. | ## Examples ### Squash on Label In this example, whenever there's a label \`to-squash\` added, any new commits pushed to the branch will be squashed into a single commit: \`\`\`yaml pull\_request\_rules: - name: automatic squash of pull requests conditions: - label = to-squash actions: squash: \`\`\` --- # Unknown \--- title: "\`repository-name\` and \`repository-full-name\`" date: 2022-02-16 tags: - Rules description: "" --- Add \`repository-name\` and \`repository-full-name\` in pull requests attributes. --- # Unknown \--- title: "Add draft\_bot\_account" date: 2022-02-07 tags: - Merge Queue - Workflow Automation description: "" --- Allow to use a \[\`draft\_bot\_account\`\](https://docs.mergify.com/actions/queue/#queue-rules) for draft pull requests in the queue action. --- # Unknown \--- title: "API configuration validation endpoint" date: 2022-04-22 tags: - Deprecations - API description: "" --- The API configuration validation endpoint has been removed. --- # Unknown \--- title: "Queue branch merge method" date: 2022-09-09 tags: - Merge Queue description: "" --- The merge queue now supports \[a new setting named \](https://docs.mergify.com/actions/queue/#queue-rules)\[\`queue\_branch\_merge\_method\`\](https://docs.mergify.com/actions/queue/#queue-rules). It allows to configure the merge behaviour of the merge queue: - By default, when unset, Mergify merges the original pull requests that are being tested in the queue. - When set to \`fast-forward\`, Mergify will rather merge the branch that is being tested by fast-forwarding the base branch to the tested branch. --- # Unknown \--- title: "\`allow\_inplace\_checks\` changes" date: 2022-05-13 tags: - Merge Queue description: "" --- The \`allow\_inplace\_checks\` option for the queue actions is now only available when speculative checks and batches mode are disabled. --- # Unknown \--- title: "Event logs availability" date: 2022-09-07 tags: - API - Merge Queue - Workflow Automation description: "" --- Mergify event logs is now available through our dashboard and \[API\](https://docs.mergify.com/api/). ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic91515294674848fa901d354d1c482d4cpng%7D) --- # Unknown \--- title: "\`commit\_message\` removed" date: 2022-04-25 tags: - Workflow Automation - Deprecations description: "" --- The deprecated merge and queue option \`commit\_message\` has been removed. --- # Unknown \--- title: "New dependabot attributes" date: 2022-08-01 tags: - Rules description: "" --- The rule system now supports \[new attributes related to Dependabot\](https://docs.mergify.com/conditions/#attributes): - \`dependabot-dependency-name\` contains the name of the dependency being updated; - \`dependabot-dependency-type\` contains the type of the depending being updated; - \`dependabot-update-type\` contains the type of update. --- # Unknown \--- title: "\`fast-forward\` merge method" date: 2022-04-22 tags: - Workflow Automation - Merge Queue description: "" --- The \`queue\` and \`merge\` action supports the \`fast-forward\` merge method. --- # Unknown \--- title: "Improve branch protection compatibility" date: 2022-10-26 tags: - Merge Queue description: "" --- Mergify now reports to the user when a branch protection setting is not compatible with a queue rule configuration. --- # Unknown \--- title: "\`commits-behind\` change" date: 2022-04-29 tags: - Rules description: "" --- The attributes \`commits-behind\` now only returns the number of commits when used, and not a list of SHA1 anymore. --- # Unknown \--- title: "New shared configuration support" date: 2022-07-20 tags: - Rules description: "" --- The configuration file now supports \[a new key named \](https://docs.mergify.com/configuration/#shared)\[\`shared\`\](https://docs.mergify.com/configuration/#shared) which allows to share configuration across several YAML rules. # Example \`\`\`yaml shared: my\_ci: &common\_checks - check-success=ci-one - check-success=ci-two queue\_rules: - name: hotfix conditions: \*common\_checks - name: default conditions: - check-success=slow-ci - and: \*common\_checks pull\_request\_rules: - name: Default merge conditions: - base=main - and: \*common\_checks actions: queue: name: default - name: Hotfix merge conditions: - base=main - label=hotfix actions: queue: name: hotfix \`\`\` --- # Unknown \--- title: "Queue branch prefix is now configurable" date: 2022-07-20 tags: - Merge Queue description: "" --- The queue action now exposes \[a new setting named \](https://docs.mergify.com/actions/queue/#queue-rules)\[\`queue\_branch\_prefix\`\](https://docs.mergify.com/actions/queue/#queue-rules). This can be used to configure the prefix used by Mergify when creating transient branches for its merge queue. The default is \`mergify/merge-queue/\`. --- # Unknown \--- title: "Deprecation of current-\* conditions" date: 2022-11-14 tags: - Rules - Deprecations description: "" --- The attributes \`current-day\`, \`current-day-of-week\`, \`current-month\`, \`current-time\`, \`current-timestamp\` and \`current-year\` are deprecated and will be removed on February, 11th 2023. We recommend using the \`schedule\` condition instead. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic80ad41b4cabc4ffc94c1c951162a9310png%7D) --- # Unknown \--- title: "Rebase action autosquash when PR is up-to-date" date: 2022-11-16 tags: - Workflow Automation description: "" --- Until now, \[the rebase action\](https://docs.mergify.com/actions/rebase/) would only run if the pull request was not up-to-date. --- # Unknown \--- title: "Commands restrictions" date: 2022-08-24 tags: - Rules - Workflow Automation description: "" --- It is now possible to limit usage of commands using the \[commands restrictions\](https://docs.mergify.com/configuration/#commands-restrictions). For example, to limit backport commands for pull requests coming from the main branch: \`\`\`yaml commands\_restrictions: backport: conditions: - base=main \`\`\` Another example, to limit backport commands usage to a specific team (or user): \`\`\`yaml commands\_restrictions: backport: conditions: - sender=@team \`\`\` --- # Unknown \--- title: "Allow queue branch edition" date: 2022-09-02 tags: - Merge Queue description: "" --- \[A new setting named \](https://docs.mergify.com/actions/queue/#queue-rules)\[\`allow\_queue\_branch\_edit\`\](https://docs.mergify.com/actions/queue/#queue-rules) has been added to the merge queue. It allows to configure whether modification done to the branch being built and tested by Mergify should cancel the job or be allowed. The default is \`false\`. --- # Unknown \--- title: "Allow to extend configuration" date: 2022-09-21 tags: - Rules description: "" --- The Mergify configuration file now supports a new keyword \`extends\` which allows to inherits from a configuration file from a different repository. \`\`\`yaml extends: myrepo pull\_request\_rules: - name: custome rule … \`\`\` --- # Unknown \--- title: "Queue statistics dashboard" date: 2022-10-14 tags: - Merge Queue description: "" --- Statistics are now available in the dashboard for the dashboard. You can see the average merge time and the statistics about the merge queue outcomes. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstaticbd7f9f0607e8494085495ee922037f29png%7D) --- # Unknown \--- title: "\`branch-protection-review-decision\` boolean conditions" date: 2022-10-06 tags: - Rules description: "" --- Mergify now supports GitHub review decision attributes, named \`branch-protection-review-decision\`. This field can be either \`APPROVED\`, \`CHANGES\_REQUESTED\` or \`REVIEW\_REQUIRED\`. It indicates whether code owners have approved or not the pull request. It is automatically injected by Mergify when its usage is detected in the GitHub branch protection settings. --- # Unknown \--- title: "New queue command" date: 2022-08-01 tags: - Workflow Automation description: "" --- The queue action can now be used as \[command\](https://docs.mergify.com/commands/#queue). This allows to queue a pull request without using the automation part of Mergify. --- # Unknown \--- title: "Allow templating in conditions" date: 2022-10-10 tags: - Rules description: "" --- Mergify conditions can now use \[the template syntax\](https://docs.mergify.com/configuration/#template) before they are evaluated. For example, you could write a rule that uses the pull request author login in a matching condition: \`\`\`yaml pull\_request\_rules: - name: post a comment if the PR title contains the author login conditions: # True if the PR title contains the author login - title~={{ author }} actions: comment: message: You seem egocentric! \`\`\` --- # Unknown \--- title: "Option priority of merge action is deprecated" date: 2022-12-15 tags: - Deprecations description: "" --- The \`priority\` option of the merge action has been marked as deprecated and will be removed on 2023-01-17. This option was not documented and has no impact on Mergify behaviour. There is no replacement for this option. --- # Unknown \--- title: "New toggle option for the \`label\` action" date: 2022-11-15 tags: - Rules description: "" --- The current way of toggling a label using Mergify is usually to write 2 sets of conditions, such as: \`\`\`yaml pull\_request\_rules: - name: add ci-fail label when a CI fails conditions: - "#check-failure>0" label: add: - ci-fail - name: remove ci-fail label when no CI fail conditions: - -"#check-failure>0" label: remove: - ci-fail \`\`\` As this can be quite cumbersome to write and maintain, it is now possible to toggle a label based on the conditions written a rule. The above example can be simplified with: \`\`\`yaml pull\_request\_rules: - name: toggle ci-fail label on CI failure conditions: - "check-failure>0" label: toggle: - ci-fail \`\`\` This will add or remove the label \`ci-fail\` depending whether the rule matches or not. --- # Unknown \--- title: "Add freeze cascading effect disabling" date: 2022-12-01 tags: - Merge Queue description: "" --- It is now possible to disable the cascading effect of freeze on queues. That means that the queue below the one being frozen will still get processed if cascading is disabled. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstaticcf4316f772354ee987641d40368d316fpng%7D) --- # Unknown \--- title: "Drop rebase\_fallback option" date: 2023-03-15 tags: - Workflow Automation - Merge Queue description: "" --- The \`merge\` and \`queue\` actions have seen the deprecated \`rebase\_fallback\` option removed. --- # Unknown \--- title: "Add priority rules" date: 2023-01-06 tags: - Merge Queue description: "" --- Pull request added to a queue can now see their priority set via the new \`priority\_rules\` attribute in the \`queue\_rules\` definitions. --- # Unknown \--- title: "Star attribute in commits list" date: 2023-03-24 tags: - Rules description: "" --- The \`commits\` attribute now supports addressing all the commits of a pull request in a \[conditions by using the \](https://docs.mergify.com/conditions/#attributes)\[\`\*\`\](https://docs.mergify.com/conditions/#attributes)\[ operator\](https://docs.mergify.com/conditions/#attributes). You can write a condition such as \`conditions\[\*\].committer!=Bob\` to verify that at least one committer of a pull request is not \`Bob\`. --- # Unknown \--- title: "Default value for rebase\_fallback" date: 2022-12-13 tags: - Deprecations description: "" --- The default value for \`rebase\_fallback\` is now \`none\`. This settings is deprecated. --- # Unknown \--- title: "Priority option for queue is deprecated" date: 2023-02-03 tags: - Merge Queue description: "" --- The \`priority\` option for the queue action is now deprecated and will be removed. They should be replaced by the new \[\`priority\_rules\`\](https://docs.mergify.com/actions/queue/#priority-rules)\[ sections\](https://docs.mergify.com/actions/queue/#priority-rules). --- # Unknown \--- title: "\`rebase\_fallback\` is deprecated" date: 2022-12-07 tags: - Deprecations description: "" --- The option \`rebase\_fallback\` is now deprecated and should not be used anymore. Mergify will always report errors in the future if a rebase merge is impossible. --- # Unknown \--- title: "Allow labels value to have template variables" date: 2023-01-18 tags: - Rules description: "" --- You can now leverage \[templates\](https://docs.mergify.com/configuration/#template) in the \[label action\](https://docs.mergify.com/actions/label/). This allows for example to add labels based on the branch name: \`\`\`yaml pull\_request\_rules: - name: tag with branch conditions: - base!=main actions: label: add: - branch:{{base}} \`\`\` --- # Unknown \--- title: "Add \`current-datetime\` condition" date: 2023-07-20 tags: - Rules description: "" --- The new \`current-datetime\` condition allows triggerring rules depending on a specific date/time (ISO 8601). --- # Unknown \--- title: "Support timestamp intervals" date: 2023-07-24 tags: - Rules description: "" --- The new \`current-datetime\` now supports \[timestamp intervals\](https://en.wikipedia.org/wiki/ISO\_8601#Time\_intervals). --- # Unknown \--- title: "Add a merge\_conditions to queue\_rules to replace conditions" date: 2023-01-18 tags: - Merge Queue description: "" --- The field \`conditions\` of \`queue\_rules\` has now been renamed \`merge\_conditions\` to make it clearer what the conditions are used for. The old field \`conditions\` still works. --- # Unknown \--- title: "Add partition\_rules" date: 2023-03-23 tags: - Merge Queue description: "" --- Mergify merge queue now offers a new section named \[\`partition\_rules\`\](https://docs.mergify.com/actions/queue/#partition-rules). This new sections helps splitting merge queues in different independent partitions that can be processed in parallel. This is especially useful when using merge queues on top of monorepos. --- # Unknown \--- title: "Automatically reembark pull request with requeue command" date: 2023-08-22 tags: - Merge Queue description: "" --- The \`requeue\` command now automatically re-embarks pull requests in the queue they were removed from. --- # Unknown \--- title: "Allow to merge Mergify configuration automatically" date: 2023-02-20 tags: - Workflow Automation description: "" --- The \`queue\` and \`merge\` action now supports a new option named \`allow\_merging\_configuration\_change\`. When set to \`true\`, this allows the actions to automatically merge any pull request that touches the Mergify configuration. --- # Unknown \--- title: "New action: github\_actions" date: 2023-08-25 tags: - Workflow Automation description: "" --- Mergify now provides \[a new action for GitHub Actions\](https://docs.mergify.com/actions/github\_actions/) which can trigger a workflow automatically. --- # Unknown \--- title: "New unqueue reason for branch update failure" date: 2023-09-12 tags: - Merge Queue description: "" --- Mergify now exposes a new reason for a pull request to be removed from the queue, which is when a branch update fails. --- # Unknown \--- title: "Add neutral\_conditions to post check action" date: 2023-11-02 tags: - Workflow Automation description: "" --- The \`post\_check\` action can now post neutral status checks using the \`neutral\_conditions\` options. --- # Unknown \--- title: "/events API deprecation" date: 2023-10-31 tags: - Deprecations description: "" --- The following API endpoints are deprecated and will be removed in a month: - \`/repos/{owner}/{repository}/pulls/{pull}/events\` - \`/repos/{owner}/{repository}/events\` They are replaced by the already functional : - \`/repos/{owner}/{repository}/logs\` --- # Unknown \--- title: "Rename \\"unqueue\\" command to \\"dequeue\\"" date: 2023-11-13 tags: - Merge Queue description: "" --- The \`unqueue\` command has been renamed to \`dequeue\`. The old name still works transparently. --- # Unknown \--- title: "Add attribute \`head-repo-full-name\`" date: 2023-10-26 tags: - Rules description: "" --- A new attribute has been added, \`head-repo-full-name\` which contains the full name of the head repository for a pull request. --- # Unknown \--- title: "Autodetect best merge method" date: 2023-10-20 tags: - Workflow Automation description: "" --- When the \`method\` attribute of the merge action is not defined, Mergify now tries to find the best merge method based on the repository settings. --- # Unknown \--- title: "Add batch\_max\_failure\_resolution\_attempts" date: 2023-01-09 tags: - Merge Queue description: "" --- The merge queue received a new option named \`batch\_max\_failure\_resolution\_attempts\`. This allow to control the number of attempts to resolve a batch failure before unqueueing pull requests. By default, Mergify will attempt to resolve a batch failure by splitting the batch multiple times until it finds the root cause of the failure. You can stop this process earlier by limiting the number of resolution attempts. Setting this to 0 will unqueue all the pull requests from a batch when a batch fails. --- # Unknown \--- title: "Add \`queue-name\` attribute" date: 2023-11-16 tags: - Rules description: "" --- A new \`queue-name\` attribute has been added, containing the name of the queue that the pull request entered. --- # Unknown \--- title: "Add routing\_conditions attribute to queue\_rules" date: 2023-02-20 tags: - Merge Queue description: "" --- In order to route pull requests when using the \`queue\` command and action, the queue rules now support a new \`routing\_conditions\` attribute. This allows to route pull request in the right queue without using pull request rules to determine their destination. --- # Unknown \--- title: "Conditions can access commit details" date: 2022-12-15 tags: - Rules description: "" --- The conditions can now use the details from the commits composing a pull requests. For example, you could write a rule like this: \`\`\`yaml pull\_request\_rules - name: label when PR is stale conditions: - "commits\[-1\].date\_committer < 7 days ago" actions: label: toggle: - stale \`\`\` --- # Unknown \--- title: "Rebasing pull requests with a random user is deprecated" date: 2023-02-01 tags: - Deprecations description: "" --- Some operations, like rebase/squash/update, require Mergify to impersonate a real user due to GitHub API limitations. In such a case, Mergify impersonates the user set \`bot\_account\` or \`update\_bot\_account\` to do it, but if the configuration option is not set, Mergify was using a random organization user. This behavior is deprecated, Mergify now uses the author of the pull request instead. If the author never logged into the Dashboard, Mergify cannot impersonate it and will not be able to queue, rebase or squash the pull request. For the \`queue\` action, public repositories accepting pull requests from users outside their organization must set a \`update\_bot\_account\` or \`update\_method: merge\`. For the \`queue\` action, pull requests opened by GitHub App will not be rebased by default anymore, a draft pull request created to check its mergeability instead. \`update\_bot\_account\` must be set to get them rebased. --- # Unknown \--- title: "New Actions read permission" date: 2023-05-31 tags: - Integrations description: "" --- Mergify now requires Actions read permissions to read workflow and workflow run details. --- # Unknown \--- title: NUnit Integration with Mergify description: Report your test results from NUnit tests to Mergify --- This guide shows how to generate JUnit reports from your NUnit tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with NUnit NUnit can generate JUnit-compatible XML reports using the built-in test adapter and various loggers available for \`dotnet test\`. ### Using dotnet test with JUnit Logger Install the JUnit test logger: \`\`\`bash dotnet add package JunitXml.TestLogger \`\`\` Run tests with JUnit output: \`\`\`bash dotnet test --logger "junit;LogFilePath=junit.xml" \`\`\` \`LogFilePath\` is resolved relative to the directory holding your test project's \`.csproj\`, not to the repository root. If your test project lives in a subdirectory, set the upload step's \`report\_path\` to the report's path from the repository root, such as \`tests/MyProject.Tests/junit.xml\`. ### Using NUnit Console Runner The NUnit Console Runner supports only two result formats, \`nunit3\` and \`nunit2\`; there is no built-in JUnit format. To get JUnit XML out of it, pass an XSLT that transforms the native \`nunit3\` output. NUnit publishes one as \[\`nunit3-junit.xslt\`\](https://github.com/nunit/nunit-transforms/tree/master/nunit3-junit): \`\`\`bash nunit3-console.exe your-test.dll "--result=junit.xml;transform=nunit3-junit.xslt" \`\`\` Quote the whole option: the semicolon separating the file name from the transform is a command separator in most shells. If you don't want to maintain an XSLT, run your tests through \`dotnet test\` with the JUnit logger instead, as shown above. ### Using NUnit Test Adapter Add the NUnit test adapter to your test project: \`\`\`xml \`\`\` Then run: \`\`\`bash dotnet test --logger junit \`\`\` Without a \`LogFilePath\`, the logger writes into the \`TestResults\` directory next to your test project. ### Using Multiple Test Result Formats You can generate multiple formats simultaneously: \`\`\`bash dotnet test --logger "console;verbosity=detailed" --logger "junit;LogFilePath=junit.xml" --logger "trx;LogFileName=results.trx" \`\`\` ### Using NUnit with Custom Settings You can also configure test settings in a \`.runsettings\` file: \`\`\`xml junit.xml \`\`\` Then run: \`\`\`bash dotnet test --settings test.runsettings \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run NUnit Tests and Generate JUnit Report id: tests continue-on-error: true run: dotnet test --logger "junit;LogFilePath=junit.xml" \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your NUnit tests. 2. A JUnit report (junit.xml) is generated. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips * Test Adapter: Ensure both NUnit and NUnit3TestAdapter packages are properly referenced in your test project. * Logger Package: Make sure the JunitXml.TestLogger package is installed and compatible with your .NET version. --- # Unknown \--- title: Minitest Integration with Mergify description: Report your test results from Minitest tests to Mergify --- This guide shows how to generate JUnit reports from your Minitest tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with Minitest Minitest doesn't have built-in JUnit support, but you can use third-party plugins to generate JUnit XML reports. ### Using minitest-junit Install the \`minitest-junit\` gem: \`\`\`ruby # Gemfile group :test do gem 'minitest-junit' end \`\`\` Then run: \`\`\`bash bundle install \`\`\` Require the gem in your test helper: \`\`\`ruby # test/test\_helper.rb require 'minitest/junit' \`\`\` Run tests with JUnit output: \`\`\`bash JUNIT\_OUTPUT\_DIR=. bundle exec ruby -Itest test/\*\*/\*\_test.rb \`\`\` ### Using minitest-reporters Install the \`minitest-reporters\` gem which includes JUnit support: \`\`\`ruby # Gemfile group :test do gem 'minitest-reporters' end \`\`\` Then run: \`\`\`bash bundle install \`\`\` Configure it in your test helper: \`\`\`ruby # test/test\_helper.rb require 'minitest/reporters' Minitest::Reporters.use! \[ Minitest::Reporters::DefaultReporter.new, Minitest::Reporters::JUnitReporter.new('junit.xml') \] \`\`\` ### Using Rake Task Create a Rake task for running tests with JUnit output: \`\`\`ruby # Rakefile require 'rake/testtask' Rake::TestTask.new(:test\_junit) do |t| t.libs << 'test' t.test\_files = FileList\['test/\*\*/\*\_test.rb'\] ENV\['JUNIT\_OUTPUT\_DIR'\] = '.' end \`\`\` Then run: \`\`\`bash bundle exec rake test\_junit \`\`\` ### Using Command Line Configuration You can also run Minitest with JUnit configuration directly: \`\`\`bash bundle exec ruby -Itest -rminitest/junit test/\*\*/\*\_test.rb \`\`\` Set the output directory with environment variable: \`\`\`bash JUNIT\_OUTPUT\_DIR=. bundle exec ruby -Itest -rminitest/junit test/\*\*/\*\_test.rb \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run Minitest Tests and Generate JUnit Report id: tests continue-on-error: true env: JUNIT\_OUTPUT\_DIR: . run: bundle exec ruby -Itest -rminitest/junit test/\*\*/\*\_test.rb \`\`\` Using \`minitest-reporters\` approach: \`\`\`yaml - name: Run Minitest Tests and Generate JUnit Report id: tests continue-on-error: true run: bundle exec rake test \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your Minitest tests. 2. A JUnit report (junit.xml) is generated. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips * Gem Installation: Ensure the chosen JUnit gem (\`minitest-junit\` or \`minitest-reporters\`) is properly installed and required. * Environment Variables: Make sure \`JUNIT\_OUTPUT\_DIR\` is set correctly when using minitest-junit. --- # Unknown \--- title: Playwright Integration with Mergify description: Report your test results from Playwright to Mergify --- This guide explains how to integrate \[Playwright\](https://playwright.dev/) with Test Insights using the \`@mergifyio/playwright\` reporter. Once installed, test results are automatically uploaded to Test Insights without any extra workflow changes. ## Installation Install the \[\`@mergifyio/playwright\`\](https://www.npmjs.com/package/@mergifyio/playwright) package alongside \`@playwright/test\` to automatically upload your test results to \*\*Test Insights\*\*. ### npm \`\`\`bash npm install --save-dev @mergifyio/playwright \`\`\` ### yarn \`\`\`bash yarn add --dev @mergifyio/playwright \`\`\` ### pnpm \`\`\`bash pnpm add --save-dev @mergifyio/playwright \`\`\` ## Configuration Setting up the reporter takes two steps. ### Wrap your Playwright config Wrap your \`playwright.config.ts\` with \`withMergify\`: \`\`\`typescript import { defineConfig } from '@playwright/test'; import { withMergify } from '@mergifyio/playwright'; export default withMergify( defineConfig({ // ... your existing configuration }) ); \`\`\` \`withMergify\` adds the Mergify reporter while preserving any reporters, \`globalSetup\`, and \`globalTeardown\` you already have configured. ### Import \`test\` and \`expect\` from Mergify In your test files, import \`test\` and \`expect\` from \`@mergifyio/playwright\` instead of \`@playwright/test\`: \`\`\`typescript import { test, expect } from '@mergifyio/playwright'; test('logs in', async ({ page }) => { // ... }); \`\`\` This import enables \[test quarantine\](/test-insights/quarantine): when a quarantined test fails, its outcome is reported as passing so it doesn't block your pipeline. :::caution If you wrap your config with \`withMergify\` but forget to update the \`test\` import, the quarantine list is fetched but never applied, so quarantined tests still fail your pipeline. ::: ## Update Your CI Workflow Your workflow should run your tests as usual while exporting the secret \`MERGIFY\_TOKEN\` as an environment variable. ### GitHub Actions Add the following to the GitHub Actions step running your tests: \`\`\`yaml env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} \`\`\` For example: \`\`\`yaml - name: Run Tests 🧪 env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} run: npx playwright test \`\`\` ### Buildkite Set \`MERGIFY\_TOKEN\` in the environment of the agents running your tests. The step itself then needs no Mergify-specific configuration: \`\`\`yaml steps: - label: "Run Tests 🧪" command: npx playwright test \`\`\` The reporter automatically collects your test results and sends them to Test Insights. ## Quarantine and Crashed Runs The \[\`test\` you import from \`@mergifyio/playwright\`\](#import-test-and-expect-from-mergify) applies \[test quarantine\](/test-insights/quarantine) inside the Playwright run. When a quarantined test ends in any failing status, a timeout included, that \`test\` sets the expected status to the outcome, so Playwright counts the result as expected and the result does not change Playwright's exit code. The exit code of your test step already accounts for quarantine, so the step needs nothing more: - Do not add \`continue-on-error: true\`. The recipes that upload a JUnit report with the \`mergifyio/gha-mergify-ci\` action need it because the action decides the job's result after the tests. Here nothing does, so it would let every real failure through. - There is no step \`id\` to set and no \`test\_step\_outcome\` to pass: both belong to that action, which this setup does not use. A crash cannot pass for a green run either. If Playwright dies mid-run, it exits non-zero and the step fails. The reporter uploads results when the run ends, so a process killed outright before then, such as by the out-of-memory killer, sends nothing to Test Insights. If the global setup that \`withMergify\` adds cannot fetch the quarantine list, the run quarantines nothing, and a quarantined test that fails makes the step fail as usual. ## Multi-Project (Cross-Browser) Runs If your \`playwright.config.ts\` defines multiple \[projects\](https://playwright.dev/docs/test-projects), such as one per browser (\`chromium\`, \`firefox\`, \`webkit\`), the same test runs once per project. By default, Test Insights identifies each test by name only, so every project's copy of a test shares the same identity and is treated as a single test. A test that passes on \`chromium\` but fails on \`webkit\` then looks flaky instead of consistently broken on one browser. To keep each project's tests separate, set \`PLAYWRIGHT\_MERGIFY\_INCLUDE\_PROJECT\_IN\_TEST\_NAME\` to \`true\`. The reporter then prefixes each test name with its project, for example \`\[chromium\] > login.spec.ts > logs in\`, so Test Insights tracks flakiness and quarantine per project: \`\`\`yaml env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} PLAYWRIGHT\_MERGIFY\_INCLUDE\_PROJECT\_IN\_TEST\_NAME: "true" \`\`\` This option is opt-in (off by default) to preserve the history of tests that already report without a project prefix. ## Verify and Review in Test Insights After pushing these changes, your next CI run reports its Playwright results automatically. \## Environment Variables | Variable | Purpose | Default | |----------|---------|---------| | \`MERGIFY\_TOKEN\` | API authentication token | \*\*Required\*\* | | \`MERGIFY\_API\_URL\` | API endpoint location | \`https://api.mergify.com\` | | \`PLAYWRIGHT\_MERGIFY\_ENABLE\` | Force-enable outside CI | \`false\` | | \`PLAYWRIGHT\_MERGIFY\_INCLUDE\_PROJECT\_IN\_TEST\_NAME\` | Prefix the project name to tests in multi-project runs | \`false\` | | \`MERGIFY\_CI\_DEBUG\` | Print spans to console instead of uploading | \`false\` | | \`MERGIFY\_TRACEPARENT\` | W3C distributed trace context | Optional | :::tip The reporter auto-activates in CI environments (detected via the \`CI\` environment variable). To enable it outside CI, set \`PLAYWRIGHT\_MERGIFY\_ENABLE=true\`. ::: --- # Unknown \--- title: PHPUnit Integration with Mergify description: Report your test results from PHPUnit tests to Mergify --- This guide shows how to generate JUnit reports from your PHPUnit tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with PHPUnit PHPUnit has built-in support for JUnit XML reports. You can configure PHPUnit to output JUnit reports using command-line options or configuration files. ### Using Command Line Options \`\`\`bash ./vendor/bin/phpunit --log-junit junit.xml \`\`\` ### Using PHPUnit Configuration Add the logging configuration to your \`phpunit.xml\` or \`phpunit.xml.dist\`: \`\`\`xml tests \`\`\` Then run: \`\`\`bash ./vendor/bin/phpunit \`\`\` ### Using Composer Scripts You can also add a script to your \`composer.json\`: \`\`\`json { "scripts": { "test": "phpunit --log-junit junit.xml" } } \`\`\` Then run: \`\`\`bash composer test \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run PHPUnit Tests and Generate JUnit Report id: tests continue-on-error: true run: ./vendor/bin/phpunit --log-junit junit.xml \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your PHPUnit tests. 2. A JUnit report (junit.xml) is generated. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips * PHPUnit Configuration: Ensure PHPUnit is properly installed via Composer and the logging configuration is correct. --- # Unknown \--- title: Pest Integration with Mergify description: Report your test results from Pest tests to Mergify --- This guide shows how to generate JUnit reports from your Pest tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with Pest Pest is built on top of PHPUnit and supports JUnit XML reports through PHPUnit's logging capabilities. You can configure Pest to output JUnit reports using command-line options or configuration files. ### Using Command Line Options \`\`\`bash ./vendor/bin/pest --log-junit junit.xml \`\`\` ### Using Pest Configuration Add the logging configuration to your \`phpunit.xml\` or \`phpunit.xml.dist\` (Pest uses PHPUnit's configuration): \`\`\`xml tests \`\`\` Then run: \`\`\`bash ./vendor/bin/pest \`\`\` ### Using Composer Scripts You can also add a script to your \`composer.json\`: \`\`\`json { "scripts": { "test": "pest --log-junit junit.xml" } } \`\`\` Then run: \`\`\`bash composer test \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run Pest Tests and Generate JUnit Report id: tests continue-on-error: true run: ./vendor/bin/pest --log-junit junit.xml \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your Pest tests. 2. A JUnit report (junit.xml) is generated. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips * Pest Configuration: Ensure Pest is properly installed via Composer and the logging configuration is correct in your PHPUnit configuration file. --- # Unknown \--- title: MSTest Integration with Mergify description: Report your test results from MSTest tests to Mergify --- This guide shows how to generate JUnit reports from your MSTest tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with MSTest MSTest can generate JUnit-compatible XML reports using the built-in logger or third-party tools. The \`dotnet test\` command supports various loggers including JUnit format. ### Using dotnet test with JUnit Logger Install the JUnit test logger: \`\`\`bash dotnet add package JunitXml.TestLogger \`\`\` Run tests with JUnit output: \`\`\`bash dotnet test --logger "junit;LogFilePath=junit.xml" \`\`\` \`LogFilePath\` is resolved relative to the directory holding your test project's \`.csproj\`, not to the repository root. If your test project lives in a subdirectory, set the upload step's \`report\_path\` to the report's path from the repository root, such as \`tests/MyProject.Tests/junit.xml\`. ### Using TRX to JUnit Conversion You can also generate TRX files and convert them to JUnit: \`\`\`bash dotnet test --logger trx --results-directory ./TestResults \`\`\` Then use a tool like \`trx2junit\` to convert: \`\`\`bash dotnet tool install -g trx2junit trx2junit ./TestResults/\*.trx \`\`\` ### Using MSTest with Test Results Add the JUnit logger package to your test project: \`\`\`xml \`\`\` Then run: \`\`\`bash dotnet test --logger junit \`\`\` Without a \`LogFilePath\`, the logger writes into the \`TestResults\` directory next to your test project. ### Using Multiple Loggers You can combine multiple loggers: \`\`\`bash dotnet test --logger "console;verbosity=detailed" --logger "junit;LogFilePath=junit.xml" \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run MSTest Tests and Generate JUnit Report id: tests continue-on-error: true run: dotnet test --logger "junit;LogFilePath=junit.xml" \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your MSTest tests. 2. A JUnit report (junit.xml) is generated. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips * Logger Package: Ensure the JunitXml.TestLogger package is added to your test project. * .NET Version: Make sure you're using a compatible version of .NET that supports the test loggers. --- # Unknown \--- title: RSpec Integration with Mergify description: Report your test results from RSpec to Mergify --- This guide explains how to integrate RSpec with Test Insights using the \`rspec-mergify\` gem. Once installed, test results are automatically uploaded to Test Insights without any extra workflow changes. ## Installation You need to install the \[\`rspec-mergify\`\](https://rubygems.org/gems/rspec-mergify) gem to automatically upload your test results to \*\*Test Insights\*\*. ### Gemfile Add the gem to your \`Gemfile\`: \`\`\`ruby group :test do gem 'rspec-mergify' end \`\`\` Then run: \`\`\`bash bundle install \`\`\` ### Gem Install Alternatively, install it directly: \`\`\`bash gem install rspec-mergify \`\`\` ## Update Your CI Workflow Your workflow should run your tests as usual while exporting the secret \`MERGIFY\_TOKEN\` as an environment variable. ### GitHub Actions Add the following to the GitHub Actions step running your tests: \`\`\`yaml env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} \`\`\` For example: \`\`\`yaml - name: Run RSpec Tests 🧪 env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} run: bundle exec rspec \`\`\` ### Buildkite Set \`MERGIFY\_TOKEN\` in the environment of the agents running your tests. The step itself then needs no Mergify-specific configuration: \`\`\`yaml steps: - label: "Run RSpec Tests 🧪" command: bundle exec rspec \`\`\` The gem automatically collects your test results and sends them to Test Insights. ## Quarantine and Crashed Runs The gem applies \[quarantine\](/test-insights/quarantine) inside the RSpec run. When a quarantined example fails, the gem marks it pending with the message \`Test is quarantined from Mergify Test Insights\`, so it does not count as a failure and does not change RSpec's exit code. The exit code of your test step already accounts for quarantine, so the step needs nothing more: - Do not add \`continue-on-error: true\`. The recipes that upload a JUnit report with the \`mergifyio/gha-mergify-ci\` action need it because the action decides the job's result after the tests. Here nothing does, so it would let every real failure through. - There is no step \`id\` to set and no \`test\_step\_outcome\` to pass: both belong to that action, which this setup does not use. A crash cannot pass for a green run either. Quarantine only covers failures inside an example: a spec file that fails to load, a failing \`before(:suite)\` or \`after(:context)\` hook, or RSpec dying mid-run still exits non-zero and fails the step. The gem uploads results when the run ends, so a process killed outright before then, such as by the out-of-memory killer, sends nothing to Test Insights. If the gem cannot fetch the quarantine list, it quarantines nothing for that run, and a quarantined example that fails makes the step fail as usual. ## Verify and Review in Test Insights After pushing these changes, your next CI run reports its RSpec results automatically. \## Environment Variables | Variable | Purpose | Default | |----------|---------|---------| | \`MERGIFY\_TOKEN\` | API authentication token | \*\*Required\*\* | | \`MERGIFY\_API\_URL\` | API endpoint location | \`https://api.mergify.com\` | | \`RSPEC\_MERGIFY\_ENABLE\` | Force-enable outside CI | \`false\` | | \`RSPEC\_MERGIFY\_DEBUG\` | Print spans to console | \`false\` | | \`MERGIFY\_TRACEPARENT\` | W3C distributed trace context | Optional | | \`MERGIFY\_TEST\_JOB\_NAME\` | Test job name identifier | Optional | :::tip The gem auto-activates in CI environments (detected via the \`CI\` environment variable). To enable it outside CI, set \`RSPEC\_MERGIFY\_ENABLE=true\`. ::: :::tip Use \`MERGIFY\_TEST\_JOB\_NAME\` to make reports clearer in Test Insights, especially when running multiple test suites or using a matrix strategy. ::: --- # Unknown \--- title: Pytest Integration with Mergify description: Report your test results from pytest to Mergify --- This guide explains how to integrate Pytest with Test Insights using the \`pytest-mergify\` plugin. Once installed, test results are automatically uploaded to Test Insights without any extra workflow changes. ## Installation You need to install the \[\`pytest-mergify\`\](https://pypi.python.org/pypi/pytest-mergify) plugin to automatically upload your test results to \*\*Test Insights\*\*. This can be done in different ways depending on your Python dependency setup. Below are a few examples: ### Pip / Requirements File \`\`\`bash pip install pytest-mergify \`\`\` Or add \`pytest-mergify\` to your \`requirements.txt\`. ### \`setup.py\` \`\`\`python setup( name="your-package", ... install\_requires=\[ ... \], extras\_require={ "dev": \["pytest-mergify"\] }, ... ) \`\`\` Make sure those dependencies are installed when running your tests. ### \`setup.cfg\` \`\`\`ini \[options.extras\_require\] dev = pytest-mergify \`\`\` Make sure those dependencies are installed when running your tests. ### Poetry \`\`\`bash poetry add --group dev pytest-mergify \`\`\` ## Update Your CI Workflow Your workflow should run your tests as usual while exporting the secret \`MERGIFY\_TOKEN\` as an environment variable. ### GitHub Actions Add the following to the GitHub Actions step running your tests: \`\`\`yaml env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} \`\`\` For example: \`\`\`yaml - name: Run Tests 🧪 env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} run: pytest \`\`\` ### Buildkite Set \`MERGIFY\_TOKEN\` in the environment of the agents running your tests. The step itself then needs no Mergify-specific configuration: \`\`\`yaml steps: - label: "Run Tests 🧪" command: pytest \`\`\` The plugin collects your test results and sends them to Test Insights. ## Quarantine and Crashed Runs The plugin applies \[quarantine\](/test-insights/quarantine) inside the pytest session. It marks each quarantined test as a non-strict \`xfail\`, so a quarantined test that fails is reported as \`xfailed\` and does not count against pytest's exit code. The exit code of your test step already accounts for quarantine, so the step needs nothing more: - Do not add \`continue-on-error: true\`. The recipes that upload a JUnit report with the \`mergifyio/gha-mergify-ci\` action need it because the action decides the job's result after the tests. Here nothing does, so it would let every real failure through. - There is no step \`id\` to set and no \`test\_step\_outcome\` to pass: both belong to that action, which this setup does not use. A crash cannot pass for a green run either. If pytest dies mid-run or fails outside a test, such as a collection error, it exits non-zero and the step fails. The plugin uploads results when the session ends, so a process killed outright before then, such as by the out-of-memory killer, sends nothing to Test Insights. A run that stops early without the process being killed, such as an interrupted session or one cut short by \`--maxfail\`, still uploads the results collected up to that point. If the plugin cannot fetch the quarantine list, it quarantines nothing for that run, and a quarantined test that fails makes the step fail as usual. ## Environment Variables | Variable | Purpose | Default | |----------|---------|---------| | \`MERGIFY\_TOKEN\` | API authentication token | \*\*Required\*\* | | \`MERGIFY\_API\_URL\` | API endpoint location | \`https://api.mergify.com\` | | \`PYTEST\_MERGIFY\_ENABLE\` | Force-enable outside CI | \`false\` | | \`PYTEST\_MERGIFY\_DEBUG\` | Print spans to console | \`false\` | | \`MERGIFY\_TRACEPARENT\` | W3C distributed trace context | Optional | | \`MERGIFY\_TEST\_JOB\_NAME\` | Test job name identifier | Optional | :::tip The plugin auto-activates in CI environments (detected via the \`CI\` environment variable). To enable it outside CI, set \`PYTEST\_MERGIFY\_ENABLE=true\`. ::: ## Using with Tox If you’re using \[Tox\](https://tox.wiki/) to manage test environments, you can still use \`pytest-mergify\` by passing the \`MERGIFY\_TOKEN\` and the rest of the CI environment variables into the test environment. On Buildkite the token comes from the agent's environment, as \[above\](#buildkite), so only the GitHub Actions step names it. In your CI workflow: \`\`\`yaml # GitHub Actions - name: Run Tox Tests env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} run: tox \`\`\` \`\`\`yaml # Buildkite steps: - label: "Run Tox Tests" command: tox \`\`\` In your \`tox.ini\`, make sure the plugin is included in your testenv dependencies: \`\`\`ini \[testenv\] # You need to pass the MERGIFY\_\*, CI, GITHUB\_\*, etc variables passenv = \* deps = pytest pytest-mergify commands = pytest \`\`\` If you’re using multiple environments (e.g. \`py38\`, \`py39\`, etc.), the plugin will work for all of them as long as the token is set correctly. If you’re running multiple Tox environments (e.g., py38, py39, etc.), we recommend setting the \`MERGIFY\_TEST\_JOB\_NAME\` environment variable to identify each environment’s report in Test Insights: In your CI workflow: \`\`\`yaml # GitHub Actions - name: Run Tox Tests env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} MERGIFY\_TEST\_JOB\_NAME: tox-${{ matrix.python-version }} run: tox \`\`\` \`\`\`yaml # Buildkite steps: - label: "Run Tox Tests ({{matrix}})" command: tox matrix: - "3.10" - "3.11" - "3.12" env: MERGIFY\_TEST\_JOB\_NAME: "tox-{{matrix}}" \`\`\` :::tip Use \`MERGIFY\_TEST\_JOB\_NAME\` to make reports clearer in Test Insights, especially when running multiple Tox environments or using a matrix. ::: ## Verify and Review in Test Insights After pushing these changes, your next CI run reports its pytest results automatically. --- # Unknown \--- title: Workflow Automation description: Automate the routine work on your pull requests with rules that react to a pull request's state to label, comment, assign, rebase, merge, and more. hubAccent: true --- Workflow Automation handles the routine work on your pull requests. You write rules in your Mergify configuration file, and Mergify carries them out: labeling, commenting, assigning, rebasing, merging, and more. Your team spends less time on pull request housekeeping. ## Anatomy of a Rule Every rule lives under \`pull\_request\_rules\` and pairs a set of \*\*conditions\*\* with the \*\*actions\*\* to run when a pull request matches them: \`\`\`yaml pull\_request\_rules: - name: add "WIP" label when the title contains "WIP" conditions: - title ~= WIP actions: label: toggle: - WIP \`\`\` Here, any pull request whose title contains \`WIP\` gets the \`WIP\` label. Once the title no longer matches, Mergify removes it. ## How Rules Are Evaluated Mergify evaluates the \*state\* of a pull request rather than individual events. It checks the current status of a pull request and acts based on the conditions you defined. This behavior is known as "edge triggering": once an action has run, Mergify does not run it again while the rule keeps matching. It runs a second time only after the pull request stops matching the rule and then matches again. Not every action works that way. \`assign\`, \`dismiss\_reviews\`, \`edit\`, \`label\`, \`post\_check\`, \`rebase\`, \`request\_reviews\`, \`review\`, \`squash\`, and \`update\` run on every evaluation instead, which is how they hold a pull request in the state a rule describes. The rule above relies on that: if someone removes the \`WIP\` label while the title still matches, Mergify puts it back. :::note Mergify never evaluates rules for pull request drafts it creates while processing the \[merge queue\](/merge-queue). ::: ## Building Blocks The \`pull\_request\_rules\` format and how to structure a rule. Match pull requests on title, labels, CI status, files, authorship, and more. The full catalog of tasks Mergify can run when a rule matches. Where rules live and how the overall config file is structured. \## Popular Actions Automate the merging of your pull requests. Add the pull request to the merge queue. Add, remove, or toggle labels on a pull request. Post a comment on a pull request. Copy a pull request to another branch once it is merged. Rebase the pull request on top of its base branch. --- # Unknown \--- title: Rust Integration with Mergify description: Report your test results from Rust tests to Mergify --- This guide shows how to generate JUnit reports from your Rust tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with Rust Tests Rust's built-in test framework doesn't output JUnit XML reports. You can either run your tests through \`cargo-nextest\`, which writes JUnit XML itself, or keep \`cargo test\` and convert its output with \`cargo2junit\`. ### Using cargo-nextest \`cargo-nextest\` is a test runner that writes JUnit XML natively. It has no command-line flag for it: you enable JUnit output per profile in your \`.config/nextest.toml\`. \`\`\`bash cargo install cargo-nextest \`\`\` Add a \`junit\` section to the profile you use in CI: \`\`\`toml # .config/nextest.toml \[profile.ci.junit\] path = "junit.xml" \`\`\` Then run that profile: \`\`\`bash cargo nextest run --profile ci \`\`\` The \`path\` is relative to the profile's output directory, so this writes \`target/nextest/ci/junit.xml\`. ### Using cargo2junit \`cargo2junit\` converts cargo's JSON test output into JUnit XML. \`\`\`bash cargo install cargo2junit \`\`\` It reads that JSON on standard input, so \`cargo test\` has to be asked for JSON rather than its usual human-readable output. That option is nightly-only, but \`RUSTC\_BOOTSTRAP=1\` unlocks it on a stable toolchain: \`\`\`bash RUSTC\_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time | cargo2junit > junit.xml \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Install cargo-nextest uses: taiki-e/install-action@nextest - name: Run Rust Tests and Generate JUnit Report id: tests continue-on-error: true run: cargo nextest run --profile ci \`\`\` Alternative approach using \`cargo2junit\`, which writes wherever you redirect it: \`\`\`yaml - name: Install cargo2junit run: cargo install cargo2junit - name: Run Rust Tests and Generate JUnit Report id: tests continue-on-error: true run: RUSTC\_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time | cargo2junit > junit.xml \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your Rust tests. 2. A JUnit report is generated at \`target/nextest/ci/junit.xml\`, or wherever you redirect \`cargo2junit\`. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips * Tool Installation: Ensure \`cargo-nextest\` or \`cargo2junit\` is properly installed before running tests. * Output Format: Verify that the chosen tool generates valid JUnit XML format. --- # Unknown \--- title: Vitest Integration with Mergify description: Report your test results from Vitest to Mergify --- This guide explains how to integrate \[Vitest\](https://vitest.dev/) with Test Insights using the \`@mergifyio/vitest\` reporter. Once installed, test results are automatically uploaded to Test Insights without any extra workflow changes. ## Installation You need to install the \[\`@mergifyio/vitest\`\](https://www.npmjs.com/package/@mergifyio/vitest) package to automatically upload your test results to \*\*Test Insights\*\*. ### npm \`\`\`bash npm install --save-dev @mergifyio/vitest \`\`\` ### yarn \`\`\`bash yarn add --dev @mergifyio/vitest \`\`\` ### pnpm \`\`\`bash pnpm add --save-dev @mergifyio/vitest \`\`\` ## Configuration Add the Mergify reporter to your \`vitest.config.ts\` (or \`vite.config.ts\`): \`\`\`typescript import { defineConfig } from 'vitest/config'; import MergifyReporter from '@mergifyio/vitest'; export default defineConfig({ test: { reporters: \['default', new MergifyReporter()\], }, }); \`\`\` The \`'default'\` reporter keeps the standard console output alongside the Mergify reporter. ## Update Your CI Workflow Your workflow should run your tests as usual while exporting the secret \`MERGIFY\_TOKEN\` as an environment variable. ### GitHub Actions Add the following to the GitHub Actions step running your tests: \`\`\`yaml env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} \`\`\` For example: \`\`\`yaml - name: Run Tests 🧪 env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} run: npm test \`\`\` ### Buildkite Set \`MERGIFY\_TOKEN\` in the environment of the agents running your tests. The step itself then needs no Mergify-specific configuration: \`\`\`yaml steps: - label: "Run Tests 🧪" command: npm test \`\`\` The reporter automatically collects your test results and sends them to Test Insights. ## Quarantine and Crashed Runs The reporter applies \[quarantine\](/test-insights/quarantine) through a test runner it installs for you. When a quarantined test fails, that runner records it as passed, so it does not change Vitest's exit code. The exit code of your test step already accounts for quarantine, so the step needs nothing more: - Do not add \`continue-on-error: true\`. The recipes that upload a JUnit report with the \`mergifyio/gha-mergify-ci\` action need it because the action decides the job's result after the tests. Here nothing does, so it would let every real failure through. - There is no step \`id\` to set and no \`test\_step\_outcome\` to pass: both belong to that action, which this setup does not use. :::caution Vitest does not load that runner in \[browser mode\](https://vitest.dev/guide/browser/), and the reporter does not install it when your configuration sets its own \`runner\` (it logs a warning instead). In both cases quarantined tests that fail still fail the run. ::: A crash cannot pass for a green run either. Quarantine only covers failing tests. Errors that Vitest reports outside a test result, such as an unhandled error or a test file that fails to load, still make it exit non-zero and fail the step, and so does Vitest dying mid-run. The reporter uploads results when the test run ends, so a process killed outright before then, such as by the out-of-memory killer, sends nothing to Test Insights. If the reporter cannot fetch the quarantine list, it quarantines nothing for that run, and a quarantined test that fails makes the step fail as usual. ## Verify and Review in Test Insights After pushing these changes, your next CI run reports its Vitest results automatically. \## Environment Variables | Variable | Purpose | Default | |----------|---------|---------| | \`MERGIFY\_TOKEN\` | API authentication token | \*\*Required\*\* | | \`MERGIFY\_API\_URL\` | API endpoint location | \`https://api.mergify.com\` | | \`VITEST\_MERGIFY\_ENABLE\` | Force-enable outside CI | \`false\` | | \`MERGIFY\_CI\_DEBUG\` | Print spans to console instead of uploading | \`false\` | | \`MERGIFY\_TRACEPARENT\` | W3C distributed trace context | Optional | :::tip The reporter auto-activates in CI environments (detected via the \`CI\` environment variable). To enable it outside CI, set \`VITEST\_MERGIFY\_ENABLE=true\`. ::: --- # Unknown \--- title: "Automatic flaky test detection and prevention" date: 2026-07-24 tags: - Test Insights description: "Mergify's test framework plugins now automatically rerun your tests to catch new flaky tests before they merge and surface existing flaky or broken tests on your default branch — all within a CI budget you control." --- Install a Mergify test framework plugin (pytest-mergify, rspec-mergify, @mergifyio/vitest, or @mergifyio/playwright) and Mergify starts rerunning your tests automatically to surface flakiness: - \*\*Prevention\*\* reruns newly added tests in your pull requests, catching a flaky new test before it can break your default branch. - \*\*Detection\*\* reruns tests on your default branch, reaching a confident flaky-or-broken verdict on existing tests sooner. Both run inside a CI budget you set (a percentage of your CI time), so you stay in control of how much extra CI the reruns use. Learn more: \[Prevention\](https://docs.mergify.com/test-insights/prevention/) · \[Detection\](https://docs.mergify.com/test-insights/detection/) --- # Unknown \--- title: "Automatic self-hosted runner tracking" date: 2026-07-24 tags: - CI Insights description: "Self-hosted runner and queue metrics now populate automatically, with no configuration required." --- CI Insights now detects your real self-hosted runners on its own: any runner that runs more than one job is tracked, while single-use ephemeral runners are ignored. There's no runner configuration to set up anymore — your runner and queue dashboards populate out of the box, including for setups that were never configured before. --- # Unknown \--- title: "Pagination drops the first and last links" date: 2026-08-25 tags: - API description: "Paginated API responses now advertise only next and prev, and omit the Link header entirely when a page has neither." --- Paginated endpoints advertised four RFC 5988 relations in their \`Link\` header. \`first\` was only ever the endpoint called without a cursor, so it told you nothing you could not already do. \`last\` was worse: it walked backward from the end of the dataset, so its page boundaries never lined up with the ones a forward walk returns, and following it showed you items shifted against every other page. Both are gone. \`next\` and \`prev\` are the supported way to page through results. Two things follow. A response with neither a next nor a previous page now carries no \`Link\` header at all, so an absent header means there is nothing more to fetch. And the endpoints that only ever offered a way forward, such as pull requests and applications, now supply \`prev\` too. --- # Unknown \--- title: "Merge GitHub stacked pull requests with the merge queue" date: 2026-08-12 tags: - Merge Queue description: "Queue any member of a GitHub-native stacked pull request and Mergify merges it, in order, through GitHub's merge API." --- Queue any member of a GitHub-native stacked pull request: Mergify evaluates your queue rules and CI on it and merges it through GitHub's asynchronous Merge API, landing the stack in order. Mergify's bypass mode must be set to \`Exempt\` on any repository ruleset protecting the target branch — that is the only bypass mode GitHub's Merge API honors. --- # Unknown \--- title: "The configuration editor tells you which sections your enabled products will never read" date: 2026-09-23 tags: - Workflow Automation - Merge Protections - Merge Queue description: "The Summary panel of the configuration editor, the Configuration changed check on a configuration pull request, and mergify config simulate now warn when a section of .mergify.yml (pull\_request\_rules, merge\_protections, queue\_rules) is never evaluated because the product that runs it is not activated on the repository — with a link to activate it." --- A repository can activate Merge Queue without Workflow Automation or Merge Protections. Until now, a \`pull\_request\_rules\` or \`merge\_protections\` section written in that repository's \`.mergify.yml\` was silently ignored: the configuration was reported as valid, and nothing said the rules were not running. Mergify now tells you, wherever it validates the configuration: - In the dashboard's \*\*configuration editor\*\*, the Summary panel still shows "The configuration is valid" — the configuration \*is\* valid — and, right below it, an "Unused Configuration Sections" warning naming each section that will not be used, the product it needs, and a link to activate that product on the repository. It appears as soon as the editor loads. - On a pull request that changes \`.mergify.yml\`, the \*\*Configuration changed\*\* check keeps its green conclusion and says "The new Mergify configuration is valid, but some sections will not be used", with the same detail in its body. - In \*\*\`mergify config simulate \`\*\*, the same warning is printed at the end of the simulation. The warning disappears on its own once the product is activated or the section removed. Pull requests: \[https://github.com/Mergifyio/monorepo/pull/40761\](https://github.com/Mergifyio/monorepo/pull/40761) (dashboard) — \[https://github.com/Mergifyio/monorepo/pull/40760\](https://github.com/Mergifyio/monorepo/pull/40760) (engine) --- # Unknown \--- title: Auto-Retry description: Automatically retry failed CI jobs to reduce false negatives caused by flaky tests and transient failures. --- CI Insights Auto-Retry helps reduce false negatives in your CI pipeline by automatically retrying failed jobs that may have failed due to flaky tests or transient issues. This feature improves the reliability of your CI process while providing insights into which jobs are consistently problematic. ## How Auto-Retry Works When a CI job fails, Auto-Retry analyzes the failure based on configurable rules to determine if it should be retried. ### Retry Process 1. \*\*Detection\*\*: Auto-Retry monitors workflow runs for job failures 2. \*\*Rule Evaluation\*\*: When jobs fail, the system evaluates them against your configured retry rules 3. \*\*Wait for Completion\*\*: If any job matches a retry rule, Auto-Retry waits for the entire workflow to complete 4. \*\*Workflow Retry\*\*: Once complete, the workflow is retried, re-running either all failed jobs or the entire workflow 5. \*\*Success Preservation\*\*: In the default \`job\` mode, previously successful jobs are not re-executed :::note Auto-Retry re-runs GitHub Actions workflow runs. Jobs reported from another CI system, such as Buildkite or Jenkins, show up in CI Insights but are never retried. Due to GitHub API limitations, Auto-Retry works at the workflow level: a matching job triggers a retry of the workflow run it belongs to, never of that job alone. Each rule picks how much of it re-runs (see \[Retry Rules\](#retry-rules)): in \`job\` mode only the failed jobs run again; in \`pipeline\` mode the whole run does, successful jobs included. ::: ## Benefits - \*\*Reduced False Negatives\*\*: Automatically handle transient failures that don't represent real code issues - \*\*Improved Developer Experience\*\*: Fewer interruptions from flaky test failures - \*\*Better CI Reliability\*\*: More consistent build results across your pipeline - \*\*Data-Driven Insights\*\*: Track which jobs are frequently retried to identify systematic issues - \*\*Time Savings\*\*: Fewer manual retry actions and faster feedback loops ## Configuration Auto-Retry uses a rule-based system to determine which workflow runs should be retried. Rules are evaluated against individual jobs, but retries occur at the workflow level. Each rule belongs to a single repository, chosen from the repository selector at the top of the Auto-Retry page. ### Basic Setup To set up Auto-Retry for a repository: 1. Navigate to your Mergify dashboard 2. Go to \*\*CI Insights\*\* → \*\*Auto-retry\*\* 3. Pick a repository from the selector at the top of the page 4. Configure your retry rules for that repository You can view, create, edit, or delete rules scoped to the selected repository. Switch repositories from the selector to manage another one. ![CI Insights retry rule configuration](https://docs.mergify.com/ci-insights/%7BruleConfig%7D) ### Retry Rules Auto-Retry rules define when a workflow should be retried based on job failures. Each rule specifies: - \*\*Conditions\*\*: When the job failure should trigger a workflow retry - \*\*Number of retries\*\*: How many times a matching job may be retried, from 1 to 10 - \*\*Retry mode\*\*: Whether to retry all failed jobs (\`job\`, the default) or the entire workflow (\`pipeline\`) When several rules match the same failed job, the one allowing the most retries applies. Because Mergify issues a single retry per workflow run, a run whose failed jobs match rules with different retry modes is retried in \`pipeline\` mode, the broader of the two. Jobs that ran on a merge queue's \[batch pull request\](/merge-queue/batches) are not retried, because the queue closes or replaces that pull request once it has read its checks, leaving a re-run nowhere to report. ### Conditions Conditions let you control which job failures should trigger a retry. Each condition matches against a specific attribute of the failed job. Every rule needs at least one condition, and when you combine several in a single rule, all of them must match for the rule to apply. The following condition attributes are available: - \*\*Job name\*\*: Match against the name of the failed job. This allows you to target retries to specific jobs known to be flaky. - \*\*Pipeline name\*\*: Match against the name of the workflow (pipeline) that contains the failed job. - \*\*Branch\*\*: Restrict the rule to specific branches. You can also enter custom branch names that are not yet in the list. Branch matching is case-sensitive, unlike job name, pipeline name, and conclusion, which ignore case. - \*\*Conclusion\*\*: Match against the type of failure. Available values are \`failure\` (the job failed) and \`timed\_out\` (the job exceeded its time limit). - \*\*Flaky\*\*: Match against whether Mergify has detected the job as flaky. Set to \`true\` to only retry jobs that have been identified as flaky, or \`false\` to only retry jobs that are not considered flaky. - \*\*Log pattern\*\*: Match against the content of the job logs and GitHub Actions check-run annotations using regular expressions. Each pattern is evaluated against individual log lines. You can specify multiple patterns; a retry is triggered if any of the patterns match. For example, \`timeout|connection refused\` would match any log line containing either "timeout" or "connection refused". The rule builder includes a \*\*Test your log patterns\*\* panel to check your log-pattern regex against sample log text before saving. --- # Unknown \--- title: "\`autosquash\` has been removed" date: 2026-09-29 tags: - Deprecations description: "Configurations that still set \`autosquash\` no longer validate." --- \`autosquash\` was deprecated on 2026-01-27 and stopped doing anything on 2026-09-09: since then the merge queue no longer squashes \`squash!\`/\`fixup!\`/\`amend!\` commits when updating a pull request in place, and neither does the \`rebase\` action. The option itself is now removed from queue rule and \`rebase\` action configuration. Any configuration that still sets \`autosquash\` — in a queue rule, in \`defaults\`, or on the \`rebase\` action — will fail validation instead of the key being silently accepted and ignored. Remove it from your Mergify configuration to keep Mergify running on the repository. --- # Unknown \--- title: CI Insights Setup – GitHub Actions description: Enable Mergify CI Insights and configure flaky test detection using GitHub Actions. --- This page explains how to enable CI Insights for a repository using GitHub Actions and how to configure repeated test executions for flaky test detection. ## Enabling CI Insights for GitHub Actions 1. Enable CI Insights for each repository you want it to cover, on the \[Repositories page\](https://dashboard.mergify.com/repositories) of the dashboard (\[docs\](/integrations/github#configuring-enabled-products)). 2. To upload your test results, you'll need to \[configure your test framework\](/test-insights#test-framework-configuration). Before doing so, create an application key with \`ci\` scope as described in the \[API Usage documentation\](/api/usage) and set it as \`MERGIFY\_TOKEN\` in your GitHub Actions secrets. This key will be used to upload test reports. ![CI Insights token in Mergify organization settings](https://docs.mergify.com/ci-insights/setup/%7BTokenScreenshot%7D) ![Adding the MERGIFY_TOKEN secret in GitHub Actions](https://docs.mergify.com/ci-insights/setup/%7BGitHubSecretsScreenshot%7D) :::tip If you use \[Dependabot\](/integrations/dependabot), you must also add \`MERGIFY\_TOKEN\` to your \*\*Dependabot secrets\*\* (\`Settings → Secrets and variables → Dependabot\`). Dependabot workflows run in a restricted environment and cannot access regular GitHub Actions secrets. ::: 3. Click on \`CI Insights\` in the Mergify dashboard navigation. You should start seeing your GitHub Actions job runs appear: ![CI Insights Jobs](https://docs.mergify.com/ci-insights/setup/%7BJobsScreenshot%7D) ## Setting Up Flaky Test Detection To effectively detect flaky tests, you need to run the same tests multiple times on the same code (identified by the SHA1 of the repository). This section explains how to set up your CI to systematically detect flaky tests. ### Prerequisites Before setting up flaky test detection, ensure you have: 1. Enabled \[CI Insights\](#enabling-ci-insights-for-github-actions) for your repository 2. Created an application key with \`ci\` scope and set it as \`MERGIFY\_TOKEN\` in GitHub Actions secrets 3. Configured test integration (e.g., \`pytest-mergify\` or JUnit report upload) for your test framework ### GitHub Actions Setup The recommended approach is to use a scheduled workflow that runs your test suite multiple times on the default branch. Here's an example configuration that runs tests twice daily with 5 repeated executions: - Example with native integration (e.g. \`pytest-mergify\`) \`\`\`yaml name: Continuous Integration on: pull\_request: schedule: - cron: '0 \*/12 \* \* 1-5' # Every 12 hours, Monday to Friday jobs: test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 # Add your specific setup steps here (Python, Node.js, etc.) - name: Run Tests env: MERGIFY\_TOKEN: ${{ secrets.MERGIFY\_TOKEN }} RUN\_COUNT: 5 # Number of times to run each test run: | # Run your test suite multiple times to detect flakiness set +e failed=0 for i in $(seq "$RUN\_COUNT"); do pytest tests/ exit\_code=$? if \[ $exit\_code -ne 0 \]; then failed=1 fi done exit $failed \`\`\` - Example with JUnit report upload via \`gha-mergify-ci\` \`\`\`yaml name: CI on: pull\_request: schedule: - cron: '0 \*/12 \* \* 1-5' # Every 12 hours, Monday to Friday jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # Add your specific setup steps here (Python, Node.js, etc.) # Modified: Run tests multiple times for flaky detection - name: Run tests env: # Run tests 5 times on schedule, once on pull\_request RUN\_COUNT: ${{ github.event\_name == 'schedule' && 5 || 1 }} run: | # Run the test suite based on RUN\_COUNT for i in $(seq $RUN\_COUNT); do echo "Running test suite - attempt $i of $RUN\_COUNT" # Run your test command with unique output file, e.g.: # npm test -- --reporters=default --reporters=jest-junit --outputFile=test-results-$i.xml done # Upload all test results to Test Insights - name: Upload test results if: always() uses: mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: token: ${{ secrets.MERGIFY\_TOKEN }} report\_path: test-results-\*.xml \`\`\` ### Configuration Tips - \*\*Frequency\*\*: Running twice daily (every 12 hours) provides a good balance between detection accuracy and resource usage - \*\*Default Branch Only\*\*: Focus on the default branch where flaky tests have the most impact - \*\*Weekday Schedule\*\*: The example runs Monday to Friday (\`1-5\`) to avoid running when no changes are made to the code - \*\*Job name\*\*: CI Insights records the job a test ran in as part of that test's identity, so the scheduled run has to report the same job name as the job running those tests on your pull requests. Otherwise the two sets of results count as two different tests. By default that name comes from \`GITHUB\_JOB\`, the workflow job's identifier. Set \`MERGIFY\_TEST\_JOB\_NAME\` on the job to report a different one. Matrix builds need it, because every matrix job reports the same \`GITHUB\_JOB\`: \`\`\`yaml jobs: test: strategy: matrix: version: \[10, 12, 14\] env: MERGIFY\_TEST\_JOB\_NAME: test (${{ matrix.version }}) \`\`\` Set it on the job rather than on a single step, so every step in the job reports the same name. A step's \`env\` applies to that step alone, so a name set on the step that runs your tests never reaches the upload step. When the upload goes through \`gha-mergify-ci\`, the action's \`job\_name\` input sets the name reported with that step's results: \`\`\`yaml - uses: mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: token: ${{ secrets.MERGIFY\_TOKEN }} report\_path: test-results-\*.xml job\_name: test (${{ matrix.version }}) \`\`\` \`job\_name\` takes precedence over \`MERGIFY\_TEST\_JOB\_NAME\` when both are set. Leave it out and the name set on the job applies. ### Key Environment Variables - \`MERGIFY\_TOKEN\`: Application key with \`ci\` scope for uploading test results to Test Insights - \`RUN\_COUNT\`: Number of times to execute each test within a single job - \`MERGIFY\_TEST\_JOB\_NAME\`: Override for the job name reported with your test results --- # Unknown \--- title: CI Insights Setup – Jenkins description: Enable Mergify CI Insights and configure flaky test detection using Jenkins. --- ## Enabling CI Insights for Jenkins 1. Enable CI Insights for each repository you want it to cover, on the \[Repositories page\](https://dashboard.mergify.com/repositories) of the dashboard (\[docs\](/integrations/github#configuring-enabled-products)). 2. Install and configure the \[Mergify Jenkins plugin\](https://plugins.jenkins.io/mergify/): \*\*Installation:\*\* - Go to \`Manage Jenkins\` → \`Manage Plugins\` - Select the \`Available\` tab - Search for \`Mergify\` and select the checkbox next to \`Mergify Plugin\` - Install the plugin using one of the install buttons at the bottom - To verify installation, search for \`Mergify Plugin\` on the \`Installed\` tab ![CI Insights Jenkins installation](https://docs.mergify.com/ci-insights/setup/%7BJenkinsInstallation%7D) \*\*Configuration:\*\* After installation, you need to add a Mergify application key with \`ci\` scope for each GitHub organization you want to support. Go to \`Manage Jenkins\` → \`Configure System\` and configure the Mergify plugin with your application keys. ![CI Insights Jenkins configuration](https://docs.mergify.com/ci-insights/setup/%7BJenkinsConfiguration%7D) \*\*Note\*\*: It's highly recommended to set the GitHub project URL for each job if you're not using the \[GitHub Branch Source plugin\](https://plugins.jenkins.io/github-branch-source/). This ensures proper correlation between Jenkins jobs and GitHub repositories. 3. Configure your Jenkins pipeline job with the \`MERGIFY\_TOKEN\` environment variable. First, create an application key with \`ci\` scope as described in the \[API Usage documentation\](/api/usage). Then add the key to Jenkins credentials and configure your pipeline to use it: \`\`\`groovy pipeline { agent any environment { MERGIFY\_TOKEN = credentials('MERGIFY\_TOKEN') } ... } \`\`\` Make sure to store your application key as a Jenkins credential with the ID \`MERGIFY\_TOKEN\`. 4. Click on \`CI Insights\` in the Mergify dashboard navigation. You should start seeing your Jenkins job runs appear: ![CI Insights Jobs](https://docs.mergify.com/ci-insights/setup/%7BJobsScreenshot%7D) ## Setting Up Flaky Test Detection To effectively detect flaky tests, you need to run the same tests multiple times on the same code (identified by the SHA1 of the repository). This section explains how to set up your CI to systematically detect flaky tests. ### Prerequisites Before setting up flaky test detection, ensure you have: 1. Enabled \[CI Insights\](#enabling-ci-insights-for-jenkins) for your repository 2. Created an application key with \`ci\` scope and set it as \`MERGIFY\_TOKEN\` in Jenkins credentials. 3. Configured test integration (e.g., \`pytest-mergify\` or JUnit report upload with \`mergify ci junit-process\`) for your test framework ### Jenkins Job Setup The recommended approach is to use a scheduled job that runs your test suite multiple times on the default branch. Here's an example configuration that runs tests twice daily with 5 repeated executions: - Example with native integration (e.g. \`pytest-mergify\`) \`\`\`groovy pipeline { agent any environment { MERGIFY\_TOKEN = credentials('MERGIFY\_TOKEN') RUN\_COUNT = '5' } triggers { cron('0 H/12 \* \* 1-5') // Every 12 hours, Monday to Friday } stages { stage('Test') { steps { sh ''' # Run your test suite multiple times to detect flakiness set +e failed=0 for i in $(seq "$RUN\_COUNT"); do pytest tests/ exit\_code=$? if \[ $exit\_code -ne 0 \]; then failed=1 fi done exit $failed ''' } } } } \`\`\` - Example with JUnit report upload via \`mergify ci junit-process\` This example calls the Mergify CLI, so the agent needs it on its \`PATH\`. Install it as part of the pipeline or bake it into your agent image; see the \[CLI installation guide\](/cli/usage). \`\`\`groovy pipeline { agent any environment { MERGIFY\_TOKEN = credentials('MERGIFY\_TOKEN') RUN\_COUNT = '5' } triggers { cron('0 H/12 \* \* 1-5') // Every 12 hours, Monday to Friday } stages { stage('Test') { steps { sh ''' # Run your test suite multiple times to detect flakiness set +e for i in $(seq "$RUN\_COUNT"); do pytest tests/ # Run your test command with unique output file, e.g.: # npm test -- --reporters=default --reporters=jest-junit --outputFile=test-results-$i.xml done set -e # Quote the glob so Mergify expands it rather than the shell; # recommended when many reports match. mergify ci junit-process 'test-results-\*.xml' ''' } } } } \`\`\` ### Configuration Tips - \*\*Frequency\*\*: Running twice daily (every 12 hours) provides a good balance between detection accuracy and resource usage - \*\*Default Branch Only\*\*: Focus on the default branch where flaky tests have the most impact - \*\*Weekday Schedule\*\*: The example runs Monday to Friday (\`1-5\`) to avoid running when no changes are made to the code - \*\*Job name\*\*: CI Insights records the job a test ran in as part of that test's identity, so the scheduled job has to report the same job name as the job running those tests on your pull requests. Otherwise the two sets of results count as two different tests. By default that name comes from Jenkins' \`JOB\_NAME\`. Set \`MERGIFY\_TEST\_JOB\_NAME\` in the pipeline's \`environment\` block to report a different one. You need this when the scheduled job and the pull request job have different Jenkins names: \`\`\`groovy environment { MERGIFY\_TEST\_JOB\_NAME = 'unit-tests' } \`\`\` ### Key Environment Variables - \`MERGIFY\_TOKEN\`: Application key with \`ci\` scope for uploading test results to Test Insights - \`RUN\_COUNT\`: Number of times to execute each test within a single job - \`MERGIFY\_TEST\_JOB\_NAME\`: Override for the job name reported with your test results --- # Unknown \--- title: Flaky Test Detection description: Set up automated flaky test detection to identify unreliable tests in your CI pipeline and improve test suite reliability. --- Flaky test detection helps you identify tests that produce inconsistent results on the same code, allowing you to improve the reliability of your test suite and reduce false positives in your CI pipeline. ## Understanding Flaky Tests A \*\*flaky test\*\* is one whose outcome doesn't follow from the code alone. Mergify looks for either of two signals: repeated runs of the same commit (SHA1) in the same pipeline and job disagree, or the test both passed and failed within the same hour on the same branch, pipeline, and job. A failure has to be part of the disagreement, so a test whose results differ without ever failing, such as one that is skipped in one run and passes in another, stays healthy. A test that only ever fails is reported as broken rather than flaky, since no run contradicts the failures. A signal on its own isn't enough. Failures that make up a very small share of a test's executions leave it healthy, and a test goes back to healthy once it has kept running, and passing, for a week after its last failure. Below is a simplified visualization of repeated runs on one commit: two executions of the same tests on the exact same commit (same SHA1) produce different results. \`\`\`dot class="queue" title="Two runs of one test on three commits: the runs that disagree flag the test as flaky" digraph { rankdir=LR; subgraph cluster\_commit1 { class="batch"; label="Commit abc123"; commit1 \[label="test\_something", shape=oval, class="config"\]; } run1 \[label="Run #1 — tests pass", class="merged"\]; run2 \[label="Run #2 — tests fail", class="failed"\]; detector \[label="Flagged as flaky", shape=note, class="flagged"\]; commit1 -> run1 \[label=" run 1"\]; commit1 -> run2 \[label=" run 2"\]; { rank=same; run1; run2; } run1 -> detector \[class="muted", style=dashed, arrowhead=none\]; run2 -> detector \[class="muted", style=dashed, arrowhead=none\]; subgraph cluster\_commit2 { class="batch"; label="Commit def456"; commit2 \[label="test\_something", shape=oval, class="config"\]; } run3 \[label="Run #1 — tests pass", class="merged"\]; run4 \[label="Run #2 — tests pass", class="merged"\]; stable \[label="Consistent\\nnot flaky", shape=note, class="external"\]; commit2 -> run3 \[label=" run 1"\]; commit2 -> run4 \[label=" run 2"\]; { rank=same; run3; run4; } run3 -> stable \[class="muted", style=dashed, arrowhead=none\]; run4 -> stable \[class="muted", style=dashed, arrowhead=none\]; subgraph cluster\_commit3 { class="batch"; label="Commit ghi789"; commit3 \[label="test\_something", shape=oval, class="config"\]; } run5 \[label="Run #1 — tests fail", class="failed"\]; run6 \[label="Run #2 — tests fail", class="failed"\]; stable2 \[label="Consistent\\nnot flaky", shape=note, class="external"\]; commit3 -> run5 \[label=" run 1"\]; commit3 -> run6 \[label=" run 2"\]; { rank=same; run5; run6; } run5 -> stable2 \[class="muted", style=dashed, arrowhead=none\]; run6 -> stable2 \[class="muted", style=dashed, arrowhead=none\]; } \`\`\` Flaky tests are problematic because they: - Create false positives that block legitimate deployments - Reduce confidence in your test suite - Waste developer time investigating non-issues - Can mask real bugs when they fail intermittently ## How Flaky Detection Works Mergify compares each uploaded test result against the results it already holds for the same test, on the same commit, in the same pipeline and job, and records any disagreement. It also watches for a test that passed and failed within the same hour on the same branch, pipeline, and job, which catches disagreements whose two runs sat on different commits. Any repeat execution counts: a retried job, a re-run workflow, or a job that runs the suite several times in a row. Detection does not depend on the scheduled runs that the setup guides below describe. Running your suite several times on the same commit produces the evidence deliberately, on a schedule you choose, instead of waiting for a rerun to expose the problem. Keeping the job name identical to the one used on your pull requests matters for the same reason: results are only compared within a single pipeline and job. ## Setting Up Flaky Test Detection See CI-specific setup guides: Configure scheduled looping runs and upload reports. Configure scheduled looping runs and upload reports. Configure scheduled looping runs and upload reports. \## Interpreting Flaky Test Results Once your flaky test detection is running, Mergify analyzes every uploaded report and flags the tests whose results disagree on a single commit. ### Where the Results Appear Test-level results live in \[Test Insights\](/test-insights), not in CI Insights: its \[Detection\](/test-insights/detection) page lists the flaky and broken tests found across your repositories and reports each one's \[impact\](/test-insights/detection#prioritizing-with-impact): the share of its executions that failed, as low, medium, or high. Flakiness at the job level stays in CI Insights, on the \[Jobs\](/ci-insights/jobs) page. ### What to Look For - \*\*High Flakiness Rate\*\*: Tests that fail inconsistently across runs on the same commit - \*\*Recent Flakiness\*\*: Newly introduced flaky behavior that may indicate recent code changes - \*\*Critical Path Tests\*\*: Flaky tests in important workflows that could block deployments - \*\*Patterns\*\*: Flakiness that occurs under specific conditions (time of day, load, etc.) ### Taking Action When flaky tests are identified: 1. \*\*Prioritize by Impact\*\*: Focus on tests that affect critical workflows first 2. \*\*Investigate Root Causes\*\*: Look for timing issues, external dependencies, or race conditions 3. \*\*Improve Test Reliability\*\*: Add proper waits, mocks, or test isolation 4. \*\*Monitor Progress\*\*: Use Test Insights to verify that fixes reduce flakiness over time ## Common Causes of Flaky Tests Understanding common causes can help you fix flaky tests more effectively: ### Timing Issues - \*\*Race conditions\*\*: Tests that depend on timing between operations - \*\*Insufficient waits\*\*: Tests that don't wait long enough for operations to complete - \*\*Timeouts\*\*: Tests with hardcoded timeouts that may vary in different environments ### External Dependencies - \*\*Network calls\*\*: Tests that make real HTTP requests - \*\*Database state\*\*: Tests that depend on specific database state - \*\*File system\*\*: Tests that read/write files without proper cleanup ### Test Isolation - \*\*Shared state\*\*: Tests that affect each other's state - \*\*Order dependencies\*\*: Tests that only pass when run in a specific order - \*\*Resource conflicts\*\*: Tests competing for the same resources ### Environment Variations - \*\*System load\*\*: Tests sensitive to CPU or memory usage - \*\*Date/time dependencies\*\*: Tests that depend on current time - \*\*Random data\*\*: Tests using non-deterministic random values ## Best Practices for Reliable Tests To prevent flaky tests: 1. \*\*Use deterministic data\*\*: Replace random values with fixed test data 2. \*\*Mock external dependencies\*\*: Isolate tests from network, database, and file system 3. \*\*Implement proper waits\*\*: Use explicit waits instead of fixed sleeps 4. \*\*Clean up after tests\*\*: Ensure each test starts with a clean state 5. \*\*Make tests independent\*\*: Each test should be able to run in isolation 6. \*\*Use stable selectors\*\*: In UI tests, use reliable element selectors 7. \*\*Handle async operations\*\*: Properly wait for asynchronous operations to complete --- # Unknown \--- title: CLI Installation & Authentication description: Install the Mergify CLI and authenticate it to manage your merge queue, freezes, and stacked pull requests from the terminal. --- The Mergify CLI lets you interact with Mergify features directly from your terminal. This page covers installation, authentication, and the exit codes commands return; for the commands themselves, see the \[CLI reference\](/cli). ## Installation ### macOS (Homebrew) On macOS, the recommended way to install the CLI is through Mergify's \[Homebrew tap\](https://github.com/Mergifyio/homebrew-tap): \`\`\`bash brew install mergifyio/tap/mergify-cli \`\`\` Upgrade with \`brew upgrade mergify-cli\`. ### Linux and macOS (install script) On Linux, or on macOS if you'd rather not use Homebrew, install with the official script: This installs \`mergify\` to \`~/.local/bin\`. Set \`MERGIFY\_INSTALL\_DIR\` to pick a different location, or \`MERGIFY\_VERSION\` to pin a specific release: \`\`\`bash curl -fsSL https://raw.githubusercontent.com/Mergifyio/mergify-cli/main/install.sh | MERGIFY\_INSTALL\_DIR="$HOME/bin" sh \`\`\` Once installed this way, upgrade with \`mergify self-update\`. ### Windows Download \`mergify-\-x86\_64-pc-windows-msvc.zip\` from the \[latest release\](https://github.com/Mergifyio/mergify-cli/releases/latest), extract it, and put \`mergify.exe\` anywhere on your \`PATH\`. ### GitHub Actions To install the CLI in a GitHub Actions workflow, use the \[\`Mergifyio/setup-cli\`\](https://github.com/Mergifyio/setup-cli) action. It downloads the prebuilt \`mergify\` binary, verifies it against the release \`SHA256SUMS\`, and adds it to the \`PATH\`. No Python or extra toolchain is required, and it runs on Linux and macOS runners. \`\`\`yaml - uses: Mergifyio/setup-cli@v2 - run: mergify --version \`\`\` By default the action installs a pinned version, which keeps your CI reproducible. Set the \`mergify\_cli\_version\` input to \`latest\` to install the newest release instead. The action also exposes the version it actually installed as the \`mergify\_cli\_version\` output: \`\`\`yaml - uses: Mergifyio/setup-cli@v2 id: setup-cli with: mergify\_cli\_version: latest - run: echo "Installed mergify-cli ${{ steps.setup-cli.outputs.mergify\_cli\_version }}" \`\`\` :::tip Pinning a specific version is the default and works well with \[Renovate\](https://docs.renovatebot.com/), which can open pull requests to bump the version as new releases ship. Use \`latest\` only when you always want the most recent build. ::: ## Authentication The CLI talks to two APIs, and they take different credentials: - The \*\*Mergify API\*\* backs \`mergify queue\`, \`mergify events\`, \`mergify freeze\`, \`mergify ci\`, \`mergify tests\`, and \`mergify config simulate\`. (\`mergify config validate\` needs no credential: it fetches the public schema and checks your file locally.) - The \*\*GitHub API\*\* backs \[Stacks\](/stacks), which creates and updates pull requests on GitHub directly. \`mergify auth login\` covers the Mergify half. Stacks still needs a GitHub token of its own. The \[\`auth\` command reference\](/cli/auth) lists the options each \`mergify auth\` command takes. ### Sign in to Mergify \`\`\`bash mergify auth login \`\`\` The CLI opens the approval page in your browser and prints the URL and a short code. Type the code in, give the token a name so you recognize the machine later, and authorize. The CLI picks up its credential and stores it. This is an \[OAuth 2.0 device authorization grant\](https://www.rfc-editor.org/rfc/rfc8628), so nothing listens on a local port and the browser does not have to be on the same machine. Over SSH or inside a container, open the printed URL on a machine that has one. Pass \`--no-browser\` to print the URL without opening a browser. What you get is a \[Mergify user token\](/api/usage#using-a-mergify-user-token). It identifies you, reaches exactly what your dashboard session reaches, and is never sent to GitHub. The CLI stores it in your operating system's credential store: Keychain on macOS, the Secret Service on Linux, Credential Manager on Windows. Where none is available, on a headless container for instance, it falls back to a file in your configuration directory, restricted to your user. On a container image or a shared runner, treat that file as the secret it is. \`mergify auth status\` reports whether this machine holds a credential: \`\`\`bash mergify auth status \`\`\` \`mergify auth logout\` revokes it on the server, not just on this machine: \`\`\`bash mergify auth logout \`\`\` You can also list and revoke your tokens under \*\*Settings > Developer > CLI Tokens\*\* in the \[dashboard\](https://dashboard.mergify.com). That list is personal, not per-organization: it shows the same tokens whichever organization you have selected. A token lasts a year, and you can hold 20 at a time. At that ceiling the approval page refuses the new login and tells you to revoke one, so watch the browser rather than the terminal if a sign-in never completes. #### On-premise installations All three commands take \`--api-url\`, and so does every other command that calls the Mergify API: \`\`\`bash mergify auth login --api-url https://mergify.example.com \`\`\` Credentials are stored per API URL, so one machine can hold a login for the hosted service and one for an \[on-premise installation\](/enterprise) at the same time. That also means the URL has to match afterwards. A command that resolves a different API URL does not find the credential you stored, and falls through to the next source in the list below. Set \`MERGIFY\_API\_URL\` once instead of passing \`--api-url\` every time: \`\`\`bash export MERGIFY\_API\_URL=https://mergify.example.com \`\`\` \`mergify auth logout\` and \`mergify auth status\` are per URL too, so signing out of one installation leaves the other's credential in place. ### How Mergify API commands find a token Commands that call the Mergify API resolve a credential in this order: 1. The \`--token\` option on the command. 2. The \`MERGIFY\_TOKEN\` environment variable. 3. The credential stored by \`mergify auth login\`, for that API URL. 4. \`GITHUB\_TOKEN\`. Deprecated. 5. \`gh auth token\`, from the GitHub CLI. Deprecated. The \`mergify ci\` commands that call the API are the exception, because the endpoints they post to accept nothing but an application key. \`mergify ci scopes-send\` skips step 3: it never reads the credential \`mergify auth login\` stored. The two JUnit upload commands, \`mergify ci junit-process\` and the deprecated \`mergify ci junit-upload\`, go further and read only \`--token\` and \`MERGIFY\_TOKEN\`, so a job that exports \`GITHUB\_TOKEN\` alone leaves them with no credential at all. There is no global \`--token\` on \`mergify\` itself, so pass it to the subcommand: \`\`\`bash mergify --token your\_token\_here \`\`\` Each command's entry in the \[CLI reference\](/cli) lists the options it accepts, \`--token\` included. The stored credential deliberately outranks \`GITHUB\_TOKEN\`, so a \`GITHUB\_TOKEN\` left exported in a shell cannot quietly override the account you signed in as. \`--token\` and \`MERGIFY\_TOKEN\` stay above it, so a CI job that sets either keeps working unchanged. :::caution Letting the CLI authenticate to the Mergify API with a GitHub token is deprecated. Both \`GITHUB\_TOKEN\` and the \`gh auth token\` fallback still work, and the CLI warns when it uses one. Run \`mergify auth login\` instead, or set \`MERGIFY\_TOKEN\` to an application key. This says nothing about Stacks, which needs a GitHub token and reads it exactly as before. ::: ### Application keys for CI \`mergify auth login\` is interactive, which makes it the wrong tool for a CI job. Unattended runs use an application key instead. Create one from your \[dashboard\](https://dashboard.mergify.com) and set it as \`MERGIFY\_TOKEN\`: \`\`\`bash export MERGIFY\_TOKEN=your\_token\_here \`\`\` An application key carries either the \`admin\` scope or the \`ci\` scope, and belongs to a GitHub account rather than to a single repository. See \[Application Key Scopes\](/api/usage#application-key-scopes) for what each one covers. \`mergify ci junit-process\` (and the deprecated \`mergify ci junit-upload\`) and \`mergify ci scopes-send\` post to endpoints that accept nothing but a \`ci\` key, so those commands need one specifically. A user token from \`mergify auth login\` does not work for them. The \`mergify tests\` commands go the other way. Apart from \`mergify tests quarantines list\`, the endpoints behind them refuse a \`ci\` key and answer \`403\`, so they need an \`admin\` key, a GitHub personal access token, or a user token. ### GitHub token for Stacks Stacks commands act on pull requests through the GitHub API, so they need a GitHub token specifically. \`mergify auth login\` does not cover them, and a Mergify application key does not work here either. They resolve that token on their own, in this order: 1. The \`--token\` option on the command. 2. The \`MERGIFY\_TOKEN\` environment variable. 3. \`GITHUB\_TOKEN\`. 4. \`gh auth token\`, from the GitHub CLI. Nothing here is deprecated: a GitHub token is what the GitHub API takes. If you have the \[GitHub CLI\](https://cli.github.com/) (\`gh\`) installed and authenticated, Stacks picks up its token automatically. Nothing else to configure. Otherwise, create a \[personal access token\](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) and set it as an environment variable: \`\`\`bash export GITHUB\_TOKEN=your\_token\_here \`\`\` :::caution Stacks commands read \`MERGIFY\_TOKEN\` before \`GITHUB\_TOKEN\`, and a Mergify application key is not a GitHub token. If \`MERGIFY\_TOKEN\` holds an application key, pass \`--token\` to your Stacks commands, or keep that key out of \`MERGIFY\_TOKEN\`. ::: ## Exit Codes The CLI reports failures with these exit codes, so a CI job can tell a conflict apart from an API failure without parsing the output: | Code | Name | Meaning | |------|------|---------| | \`0\` | \`Success\` | Command completed successfully. | | \`1\` | \`GenericError\` | Unclassified runtime failure (I/O error, bug, or captured panic). | | \`3\` | \`StackNotFound\` | Stack, branch, or commit not found. | | \`4\` | \`Conflict\` | Rebase or merge conflict. | | \`5\` | \`GitHubApiError\` | GitHub API request failed. | | \`6\` | \`MergifyApiError\` | Mergify API request failed. | | \`7\` | \`InvalidState\` | CLI invariant violated (e.g. command run outside a valid context). | | \`8\` | \`ConfigurationError\` | Configuration or credentials missing, unparseable, or failing validation. | --- # Unknown \--- title: Mergify Backport Command description: Copy a pull request to another branch after merge. --- The \`backport\` command is especially useful for projects that maintain multiple branches simultaneously. It automates the process of creating a new pull request to apply changes from a merged pull request onto another branch, whether you're maintaining different versions of your software or need to ensure that bug fixes are propagated to all active branches. Once the backport is initiated, Mergify will provide feedback directly in the comments. If the backport is successful, you'll receive a link to the newly created pull request. If there are issues, Mergify will provide a brief description of the problem. If Mergify encounters merge conflicts during the backport process, it will create a pull request with the conflicts. You'll need to manually resolve these conflicts within GitHub. The \`backport\` command is especially handy for: - \*\*Version Maintenance\*\*: Quickly propagate bug fixes to older, maintained versions of your software. - \*\*Feature Parity\*\*: Ensure that features developed on a mainline branch are also available on other active branches. :::note This command is also \[available as an action\](/workflow/actions/backport). ::: :::tip\[Tips\] - Always review the generated backport pull request before merging, to ensure that the changes are compatible with the target branch. - If you anticipate a challenging backport due to major differences between branches, consider manually preparing the branch before invoking the \`backport\` command. ::: ## Syntax \`\`\`text @Mergifyio backport \[\] \[…\] \`\`\` ## Parameters - \`\`: The name of the branch to which the changes should be backported. \## Example Suppose you have a pull request that was merged into \`main\`, but you also want to apply these changes to a branch named \`v2.0-stable\`. You would use the command as follows: \`\`\`text @Mergifyio backport v2.0-stable \`\`\` Upon executing this command, Mergify will attempt to automatically create a new pull request with the changes onto the \`v2.0-stable\` branch as soon as the original pull request is merged. --- # Unknown \--- title: Mergify Commands description: Complete list of commands you can use with Mergify. --- Mergify commands are directives that you can invoke directly from your repository's comments. They let you run specific actions on pull requests without leaving the GitHub interface. Whether you wish to rebase a branch, refresh checks, or perform any other Mergify-supported action, a simple command can save you time and clicks. ## Getting Started with Commands Commands are invoked directly within the comments section of your pull requests, as part of your regular GitHub workflow. Here's a step-by-step guide to getting started: 1. \*\*Navigate to Your Pull Request\*\*: Head over to the pull request where you want to execute a Mergify action. 2. \*\*Enter Command in the Comment Section\*\*: In the comment box, type the Mergify command you wish to use. All Mergify commands are prefixed with \`@Mergifyio\` to ensure they're correctly identified and executed by the bot. For instance, to rebase your pull request, you'd type \`@Mergifyio rebase\`. \`@Mergify\` works too, and neither prefix is case-sensitive, so \`@mergifyio rebase\` and \`@Mergifyio rebase\` are the same command. Mergify only reads a command that starts the comment, with a single space between \`@Mergifyio\` and the command name. \`Please @Mergifyio rebase\` runs nothing, and neither does a command written after a line of text. Arguments go on that same line; anything on the lines below is left alone. 3. \*\*Submit the Comment\*\*: Click on the "Comment" button to post your command. Mergify will immediately detect the command and begin processing your request. Mergify will acknowledge the comment with a 👍 reaction and you'll see a response from the Mergify bot confirming the action or providing feedback in case of errors. 4. \*\*Check Mergify's Feedback\*\*: Once the action is complete, Mergify will typically leave a comment or update the pull request's status to let you know the outcome. This feedback can be especially useful to understand any issues or conflicts that might arise from the command. The \[\`queue\`\](/commands/queue) and \[\`dequeue\`\](/commands/dequeue) commands are the exception: their outcome arrives in the \[merge queue status comment\](/merge-queue/lifecycle#status-comments) rather than in a reply to your comment. Mergify still replies directly when the command leaves the pull request out of the queue: a failure before it enters the queue, or a \`dequeue\` on a pull request that is not queued. The "Mergify Merge Queue" check run records the outcome either way, including when \`merge\_queue.status\_comments\` turns those comments off. 5. \*\*Advanced Commands\*\*: Some commands may accept additional parameters or have specific nuances. Always refer back to this documentation to understand the complete syntax and behavior. ![Example command comment in GitHub](https://docs.mergify.com/%7BcommandExample%7D) Always make sure you understand the impact of a command, especially in a collaborative environment. Misused commands can disrupt the workflow of other contributors. ## Command List Copy a pull request to another branch after merge. Copy a pull request to another branch. Add a pull request to a merge queue. Rebase a pull request. Refresh Mergify status of a pull request. Squash the commits of a pull request into one. Update a pull request by merging its base branch. Remove a pull request from a merge queue. --- # Unknown \--- title: Mergify Copy Command description: Copy a pull request to another branch. --- The \`copy\` command replicates changes from a pull request to another branch within the same repository. This is particularly useful for teams working with multiple branches, such as feature branches, and wanting to propagate changes without manually creating multiple pull requests. The \`copy\` command can simplify your branching strategy and development flow by quickly mirroring changes where needed. After initiating the copy process, Mergify will provide feedback via comments. If the copy is successful, a link to the new pull request will be provided. In case of issues, Mergify will provide a concise description of the problem. If Mergify encounters merge conflicts during the copying process, it will create a pull request with the unresolved conflicts. These will need to be resolved manually on GitHub. The \`copy\` command is especially handy for: - \*\*Feature Propagation\*\*: When a change made in one branch, such as a feature branch, needs to be mirrored in another branch, like a development or staging branch. - \*\*Hotfixes and Quick Patches\*\*: When a quick fix made in one branch needs to be propagated to multiple other branches. :::tip\[Tips\] - Always review the new pull request created by the \`copy\` command before merging. This ensures that the copied changes align with the intent and context of the destination branch. - Communicate with your team when using the \`copy\` command, especially if multiple developers are working on the same branches. ::: ## Syntax \`\`\`text @Mergifyio copy \[\] \[…\] \`\`\` ## Parameters - \`\`: The destination branch within the same repository. \## Example Assume you have made changes in a pull request targeting the \`feature-x\` branch and you want to copy these changes to the \`development\` branch: \`\`\`text @Mergifyio copy development \`\`\` Mergify will then try to create a new pull request in the \`development\` branch with the changes from the current pull request. --- # Unknown \--- title: Mergify Dequeue Command description: Remove a pull request from a merge queue. --- The \`dequeue\` command removes a pull request from the merge queue. This command is ideal for situations where you realize a pull request either shouldn't be merged or needs further revision before merging. ## Syntax \`\`\`text @Mergifyio dequeue \`\`\` ## What It Cancels A \[\`queue\` command\](/commands/queue) leaves a pull request in one of two states, and \`dequeue\` covers both: - \*\*In the queue.\*\* Mergify takes the pull request out and reports that it has been removed from the queue. - \*\*Waiting to enter it.\*\* A \`queue\` command stays pending until the pull request matches a queue's \`queue\_conditions\`. \`dequeue\` cancels that pending command, so the pull request is not queued later when the conditions eventually match. When neither applies, Mergify answers that the pull request is not queued and does nothing else. A dequeued pull request never rejoins the queue on its own. Run \[\`@mergifyio queue\`\](/commands/queue) again once it's ready, as described in \[Requeuing a Pull Request in the Merge Queue\](/merge-queue/lifecycle#requeuing-a-pull-request-in-the-merge-queue). Dequeuing a pull request that others are stacked on top of also removes the ones above it that are still in the queue. See \[cascade dequeue\](/merge-queue/stacks#cascade-dequeue). --- # Unknown \--- title: Command Restriction description: Set limitations on who can execute specific Mergify commands. --- In some scenarios, you might want to restrict who can use Mergify commands to ensure they're executed only by authorized individuals. The command restrictions feature allows you to define a set of users or teams who are permitted to use specific Mergify commands. ## How Restrictions Work With command restrictions, you can use \[conditions\](/configuration/conditions) to define the valid context that is authorized to run a specific command. This could be a list of allowed users or teams, or even attributes related to the pull request itself. The restrictions are configured with the top-level key \`commands\_restrictions\` which can specify restrictions for each command. ### Examples To limit backport commands for pull requests coming from the \`main\` branch: \`\`\`yaml commands\_restrictions: backport: conditions: - base = main \`\`\` To limit backport commands usage to a specific team (or user): \`\`\`yaml commands\_restrictions: backport: conditions: - sender = @team \`\`\` To limit backport commands for users with a specific permission on the repository: \`\`\`yaml commands\_restrictions: backport: conditions: - sender-permission >= write \`\`\` ## Default Restrictions Every command already has a default restriction, so you only need to configure one when you want something other than the default. Most commands require \`sender-permission >= write\`: only someone who can write to the repository can run them. \`update\`, \`rebase\`, \`squash\` and \`refresh\` are the commands a contributor is expected to run on their own pull request. They also accept the pull request's own author, but only when the pull request \[comes from a fork\](/configuration/conditions#attributes-list): \`\`\`yaml conditions: - or: - sender-permission >= write - and: - sender = {{author}} - from-fork \`\`\` The fork condition matters because \`update\`, \`rebase\` and \`squash\` rewrite the pull request's head branch. On a pull request opened from a fork, that branch lives outside your repository, so rewriting it touches nothing you protect. On one opened from a branch of your own repository, the head branch is one of yours. Pushing such a branch takes write permission, but opening a pull request from one that already exists takes only read permission. Without the fork condition, someone with only read permission could open a pull request from one of your branches and have Mergify rewrite it on their behalf. \`refresh\` rewrites nothing: it only reevaluates the pull request against your configuration. It carries the same default anyway, so the four commands a contributor reaches for on their own pull request all behave alike. If you want the author of a same-repository pull request to be able to run these commands too, set the restriction yourself: \`\`\`yaml commands\_restrictions: rebase: conditions: - or: - sender-permission >= write - sender = {{author}} \`\`\` To drop a command's default restriction altogether, set its \`conditions\` to \`true\`. That's shorthand for an empty list of conditions. With nothing to check, anyone who can comment on the pull request can run the command: \`\`\`yaml commands\_restrictions: refresh: conditions: true \`\`\` :::caution Setting \`conditions\` to \`true\` for \`update\`, \`rebase\` or \`squash\` drops both halves of the default: the permission check and the fork condition above. These commands rewrite the pull request's head branch, and together those two conditions stop someone with only read permission from opening a pull request from one of your own branches and having Mergify rewrite it for them. ::: | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`backport\` | Command Restrictions | \`{"conditions":\["sender-permission >= write"\]}\` | | | \`copy\` | Command Restrictions | \`{"conditions":\["sender-permission >= write"\]}\` | | | \`dequeue\` | Command Restrictions | \`{"conditions":\["sender-permission >= write"\]}\` | | | \`queue\` | Command Restrictions | \`{"conditions":\["sender-permission >= write"\]}\` | | | \`rebase\` | Command Restrictions | \`{"conditions":\[{"or":\["sender-permission >= write",{"and":\["sender = {{author}}","from-fork"\]}\]}\]}\` | | | \`refresh\` | Command Restrictions | \`{"conditions":\[{"or":\["sender-permission >= write",{"and":\["sender = {{author}}","from-fork"\]}\]}\]}\` | | | \`requeue\` | Command Restrictions | \`{"conditions":\["sender-permission >= write"\]}\` | | | \`squash\` | Command Restrictions | \`{"conditions":\[{"or":\["sender-permission >= write",{"and":\["sender = {{author}}","from-fork"\]}\]}\]}\` | | | \`update\` | Command Restrictions | \`{"conditions":\[{"or":\["sender-permission >= write",{"and":\["sender = {{author}}","from-fork"\]}\]}\]}\` | | ### Command Restriction Format | Key name | Value type | Description | | --- | --- | --- | | \`conditions\` | List of conditions | | --- # Unknown \--- title: Mergify Queue Command description: Add a pull request to a merge queue. --- The \`queue\` command in Mergify offers users a direct way to interact with the \[Mergify merge queue\](/merge-queue), right from their pull request comments. With this command, users can add a pull request to a merge queue or re-add it after it has been dequeued. To enter a queue, a pull request must match the \`queue\_conditions\` of the targeted queue. See \[Adding a Pull Request to the Merge Queue\](/merge-queue/lifecycle#adding-a-pull-request-to-the-merge-queue) for more details. :::tip\[Tips\] If you're unsure about the state or position of your pull request within a queue, refer to \[Mergify's dashboard\](https://dashboard.mergify.com) for a visual representation. ::: ## Syntax \`\`\`text @mergifyio queue \[queue-name\] \`\`\` ## Parameters - \`\[queue-name\]\` is an optional queue name. If no queue name is specified, the pull request will be queued in the first queue that matches the \`queue\_conditions\`. ## Example ### Adding a Pull Request to a Queue To add a pull request to a queue, simply use: \`\`\`text @mergifyio queue \`\`\` This command will place the pull request in the first queue that matches \`queue\_conditions\`. ### Adding a Pull Request to a Specific Queue To add a pull request to a specific queue, simply use: \`\`\`text @mergifyio queue production \`\`\` This command will place the pull request in the \`production\` queue as soon as it passes its \`queue\_conditions\`. ### Re-queuing a Previously Dequeued Pull Request If a pull request was removed from the merge queue (due to a failed check, a flaky test, or a manual \`dequeue\`), you can re-add it using the same \`queue\` command: \`\`\`text @mergifyio queue \`\`\` The command resets the pull request status and places it back in the merge queue, allowing Mergify to retry validation. :::note The \`requeue\` command is deprecated. Use \`@mergifyio queue\` for both initial queuing and re-queuing. ::: ## Running the Command Twice A \`queue\` command stays pending until the pull request matches a queue's \`queue\_conditions\`, so a second one can arrive while the first is still waiting. What happens then depends on the queue name: - \*\*The same name, or neither command naming one\*\*: the second command is ignored, and Mergify answers that it is already running from a previous command. - \*\*A different name\*\*: the pending command is cancelled and the new one takes over. If the pull request had already entered a queue, the switch takes it out of that one first. To call off a pending \`queue\` command rather than replace it, use the \[\`dequeue\` command\](/commands/dequeue). ## Queueing with a Checkbox If you'd rather not type a command, Mergify can post a checkbox you can tick to queue your pull request: ![Comment with a checkbox to queue the pull request](https://docs.mergify.com/commands/%7BqueueControlCheckbox%7D) - \*\*Queue this pull request\*\* comes in a comment of its own, posted when the pull request is ready to be queued and isn't queued yet. Tick it to add the pull request to the merge queue. - \*\*Requeue this pull request\*\* comes in the \[merge queue status comment\](/merge-queue/lifecycle#status-comments), after the pull request has left the queue without being merged. Tick it to put the pull request back in the queue. Ticking a checkbox does exactly what the \`@mergifyio queue\` command does. The action is attributed to the person who ticked it, and the same \[command restrictions\](/commands/restrictions) and write-permission checks apply, so a checkbox can't queue a pull request that the person couldn't queue manually. This is enabled by default. To turn it off, set \`queue\_controls\_comment\` to \`false\` in your \`merge\_queue\` configuration: \`\`\`yaml merge\_queue: queue\_controls\_comment: false \`\`\` --- # Unknown \--- title: Mergify Update Command description: Update a pull request by merging its base branch into it. --- The \`update\` command keeps pull requests current with their base branch. When the base branch sees frequent changes, it's not uncommon for pull requests to become outdated. Instead of manually merging the base branch, you can let the \`update\` command take care of it. ## Syntax \`\`\`text @Mergifyio update \`\`\` ## Fork Pull Requests \`update\` merges the base branch into the pull request rather than rewriting its head branch, and it impersonates nobody unless you configure a \[\`bot\_account\`\](/configuration/data-types#bot-account). Use it on pull requests opened from a fork, where \[\`rebase\`\](/commands/rebase) refuses to run. The merge commit still lands on the pull request's head branch, which on a fork belongs to the author's repository. When the base repository is public, the author has to have allowed maintainers to modify that branch; without it, the command reports that Mergify needs the author's permission to update the branch, and only the author can unblock it, by enabling the setting or updating the branch themselves. GitHub documents it under \[allowing changes to a pull request branch created from a fork\]\[gh-fork-edits\]. Mergify also checks which repository that head branch lives in, and writes the branch only when it belongs to your repository or to a fork of it. Apart from a head repository that has been deleted, this can only refuse a write when your own repository is itself a fork: any other repository is the root of its own fork network, so every head it sees descends from it. See \[the \`update\` action\](/workflow/actions/update#fork-pull-requests) for the cases it refuses. \[gh-fork-edits\]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork --- # Unknown \--- title: Mergify Rebase Command description: Rebase a pull request. --- The \`rebase\` command provides users with an instant method to instruct Mergify to rebase a pull request against its base branch. It's a handy way to ensure that the pull request is updated with the latest changes from the base branch without manually triggering a rebase. The \`rebase\` command lets developers keep their pull requests up-to-date and maintain a clean commit history. :::caution This command does not rebase a pull request opened from a fork. It reports that the pull request cannot be rebased; use the \[\`update\` command\](/commands/update) on those instead. ::: ## Syntax To make use of the \`rebase\` command, simply comment on the desired pull request: \`\`\`text @mergifyio rebase \`\`\` ![Posting '@mergifyio rebase' in GitHub interface](https://docs.mergify.com/commands/%7BrebaseScreenshot%7D) ## Impersonation Mergify pushes the rebased branch as a GitHub user, not as itself. Unless a \[\`bot\_account\`\](/configuration/data-types#bot-account) is configured, that user is whoever posted the command, and that account must have signed in to the \[Mergify dashboard\](https://dashboard.mergify.com) at least once. If it has not, the command fails with \`Mergify can't impersonate\`. That account cannot be a bot: Mergify cannot impersonate an account owned by another GitHub App. When a GitHub App posts the command, the fallback account is that bot, and the command fails. Set \`bot\_account\` to a user account so the command still runs. A fork's head branch lives in another repository, and Mergify can only force-push the rewritten branch there as the impersonated user. That is why Mergify refuses the command on a pull request opened from a fork, even when \`bot\_account\` is set: the account it names would be the one force-pushing a contributor's branch. A pull request opened from another repository whose head branch Mergify cannot write at all, such as one whose fork has been deleted, is refused for that reason instead, and the check run says so. \[The \`update\` action\](/workflow/actions/update#fork-pull-requests) covers those cases, which refuse \`update\` too. The \[\`update\` command\](/commands/update) merges the base branch instead of rewriting the head branch, and impersonates nobody unless you configure a \`bot\_account\`, so it keeps working on pull requests opened from a fork. --- # Unknown \--- title: Mergify Squash Command description: Squash the commits of a pull request into one. --- The \`squash\` command condenses all the changes from a pull request into a single commit. For PRs that come with many incremental commits, it keeps the commit history neat and concise, especially when you wish to merge a pull request without the clutter of multiple individual commits. The \`squash\` command is useful for: - \*\*Clarity and Neatness\*\*: Maintaining a clean commit history, especially when numerous commits have only minor changes. - \*\*Simplified Review\*\*: When reviewers prefer seeing the entirety of changes in one commit, making the review process more straightforward. ## Syntax \`\`\`text @Mergifyio squash \[\] \`\`\` ## Parameters - \`commit message format\` defines what commit message to use for the squashed commit. Possible values are: - \`all-commits\` to use the same format as GitHub squashed merge commit (default). - \`first-commit\` to use the message of the first commit of the pull request. - \`title+body\` means to use the title and body from the pull request itself as the commit message. The pull request number will be added to end of the title. ## Impersonation Squashing force-pushes the pull request's head branch, and Mergify does that as a GitHub user rather than as itself. Unless a \[\`bot\_account\`\](/configuration/data-types#bot-account) is configured, that user is whoever posted the command, and that account must have signed in to the \[Mergify dashboard\](https://dashboard.mergify.com) at least once. If it has not, the command fails with \`Mergify can't impersonate\`. That account cannot be a bot: Mergify cannot impersonate an account owned by another GitHub App. When a GitHub App posts the command, the fallback account is that bot, and the command fails. Set \`bot\_account\` to a user account so the command still runs. Mergify also checks which repository that head branch lives in, and writes the branch only when it belongs to your repository or to a fork of it. See \[the \`update\` action\](/workflow/actions/update#fork-pull-requests) for the cases it refuses. --- # Unknown \--- title: Integrating GitHub Actions with Mergify description: Run CI Insights, Job Selection, and Merge Queue Scopes on GitHub Actions. --- \[GitHub Actions\](https://github.com/features/actions) is the CI/CD platform provided by GitHub. Mergify has native integrations for GitHub Actions covering CI Insights, Job Selection, and Merge Queue Scopes. Any GitHub Actions job status can also be referenced from your Mergify \[conditions\](/configuration/conditions) via \`check-success\`. ## Prerequisites 1. You've set up GitHub Actions in your repository. If you're new to GitHub Actions, see their \[official documentation\](https://docs.github.com/en/actions). 2. GitHub Actions is already configured to report job statuses to your pull requests. 3. The \[Mergify GitHub App\](/integrations/github) is installed in your repository. ## Mergify features for GitHub Actions - \*\*\[CI Insights\](/ci-insights/setup/github-actions)\*\*: collect job metrics, detect flaky tests, and get Slack notifications for CI failures. - \*\*\[Job Selection\](#job-selection)\*\*: skip unaffected jobs on pull requests to cut CI spend in monorepos. - \*\*\[Merge Queue Scopes\](/merge-queue/scopes)\*\*: run only the jobs affected by a batch when processing the merge queue. Examples for \[Bazel\](/merge-queue/scopes/bazel), \[Nx\](/merge-queue/scopes/nx), and \[Turborepo\](/merge-queue/scopes/turborepo) are available. - \*\*\[\`github\_actions\` action\](/workflow/actions/github\_actions)\*\* (deprecated): trigger a workflow directly from a Mergify rule. :::caution To match a GitHub Actions status check with \`check-success\`, use the job name only, not the workflow name. ::: {/\* Keeps links to the section's former name, Monorepo CI, landing here. \*/} \## Job Selection Job Selection is \[scopes\](/merge-queue/scopes) applied to your workflows. The same \`scopes\` block that lets the merge queue batch by scope also tells each job whether it has work to do, so a pull request that only touches the frontend does not pay for the API and docs test suites. This section covers job skipping on pull requests. For smarter batching or \[parallel mode\](/merge-queue/queue-modes#parallel-mode) in the merge queue, scopes already do that on their own. See \[Merge Queue Scopes\](/merge-queue/scopes). Running Buildkite instead? The \[Buildkite integration\](/integrations/buildkite#job-selection) covers the same ground. Scopes themselves are CI-agnostic, so for any other provider \[let us know\](mailto:support@mergify.com) and see \[other build tools\](/merge-queue/scopes/others). ### Declare your scopes The action reads the \`scopes\` block of your \`.mergify.yml\` to know which areas of the repository map to each scope name: \`\`\`yaml scopes: source: files: frontend: include: - apps/web/\*\*/\* api: include: - services/api/\*\*/\* docs: include: - docs/\*\*/\* \`\`\` ### Workflow outline A GitHub Actions workflow driven by scopes has three parts: 1. \*\*Detect scopes\*\* using the \[\`gha-mergify-ci\`\](https://github.com/Mergifyio/gha-mergify-ci) action. Its inputs and outputs are listed in the \[action reference\](/integrations/gha/reference). 2. \*\*Reuse the scope outputs\*\* to conditionally run jobs. 3. \*\*Publish a final status\*\* (for example with a \`ci-gate\` job) if you want one check that reflects all the jobs that ran. \`\`\`dot class="queue" title="detect-scopes runs first, and each test job runs only when its scope changed" digraph { PR \[label="Pull request\\nchanges", class="external"\]; Config \[label="Scopes config\\n(.mergify.yml)", class="config"\]; Detect \[label="detect-scopes job\\n(gha-mergify-ci)", class="pending"\]; Frontend \[label="frontend-tests\\n(run)", class="pending"\]; Docs \[label="docs-tests\\n(run)", class="pending"\]; API \[label="api-tests\\n(skipped)", class="muted"\]; PR -> Detect; Config -> Detect; Detect -> Frontend \[label="scope: frontend"\]; Detect -> Docs \[label="scope: docs"\]; Detect -> API \[label="scope: api (false)", class="muted", style=dashed\]; Gate \[label="ci-gate\\n(optional)", class="external"\]; Frontend -> Gate; Docs -> Gate; } \`\`\` ### Example workflow :::caution On a \`pull\_request\` event the \`scopes\` action works out the base and head to diff on its own. Any other event has no pull request to take them from, so either pass an explicit \[\`base\`\](/integrations/gha/reference#input-base), or guard the job with \`if: ${{ github.event\_name == 'pull\_request' }}\` and skip it. Sending the scopes to Mergify is a no-op outside a pull request either way: on other events the action only writes its \`scopes\` output. ::: \`\`\`yaml name: CI on: pull\_request: jobs: detect-scopes: runs-on: ubuntu-24.04 outputs: frontend: ${{ fromJSON(steps.scopes.outputs.scopes).frontend }} api: ${{ fromJSON(steps.scopes.outputs.scopes).api }} docs: ${{ fromJSON(steps.scopes.outputs.scopes).docs }} steps: - uses: actions/checkout@v5 - name: Detect scopes id: scopes uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes token: ${{ secrets.MERGIFY\_TOKEN }} frontend-tests: needs: detect-scopes if: ${{ needs.detect-scopes.outputs.frontend == 'true' }} uses: ./.github/workflows/frontend-tests.yaml secrets: inherit api-tests: needs: detect-scopes if: ${{ needs.detect-scopes.outputs.api == 'true' }} uses: ./.github/workflows/api-tests.yaml secrets: inherit docs-tests: needs: detect-scopes if: ${{ needs.detect-scopes.outputs.docs == 'true' }} uses: ./.github/workflows/docs-tests.yaml secrets: inherit ci-gate: if: ${{ !cancelled() }} needs: - detect-scopes - frontend-tests - api-tests - docs-tests runs-on: ubuntu-24.04 steps: - name: Report status uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: wait-jobs jobs: ${{ toJSON(needs) }} \`\`\` In this workflow: - \`detect-scopes\` calls \`gha-mergify-ci\` with the \`scopes\` action, which inspects the pull request diff and returns a JSON map of scopes set to \`true\` or \`false\`. - Each job checks the scope it cares about before running, reducing redundant builds. - The final \`ci-gate\` job ensures that the aggregated status reflects the actual CI coverage, even if some jobs were skipped. Keep \`detect-scopes\` in its \`needs\`: without it, a failed scope detection skips every test job and \`ci-gate\` still reports success. The \`token\` on \`detect-scopes\` is a Mergify application key with the \[\`ci\` scope\](/api/usage#application-key-scopes), stored as a repository secret; an \`admin\` key is rejected. It lets the action send the scopes it detected back to Mergify, which is how \[Merge Queue Scopes\](/merge-queue/scopes) know what a queued pull request affects. \`wait-jobs\` needs no token. For pull requests opened by Dependabot, add the same secret to your \[Dependabot secrets\](/integrations/dependabot#configuring-mergify\_token-for-dependabot) as well. Mergify also publishes annotations that can be seen in your GitHub Actions jobs summary. ![GitHub Actions job summary listing the scopes detected for a pull request](https://docs.mergify.com/integrations/%7BghaSummaryScreenshot%7D) ### Protecting the branch with \`ci-gate\` Once \`ci-gate\` publishes a single status, add it as a required check in your GitHub branch ruleset so that only pull requests with the relevant jobs executed can merge. --- # Unknown \--- title: Mergify Configuration File description: Everything you need to know about Mergify configuration file --- This page documents the Mergify configuration file: its name, its format, and the data structure schema. ## Configuration File Name Mergify applies the following rule to find and use its configuration: - It reads the first file it finds among \`.mergify.yml\`, \`.mergify.yaml\`, \`.mergify/config.yml\`, \`.mergify/config.yaml\`, \`.github/mergify.yml\` and \`.github/mergify.yaml\`, in that order, from the repository root directory. - It reads the file from the default repository branch configured on GitHub (usually \`main\`). - It can extend the configuration with another configuration file using the \`extends\` keyword; see \[Extending Configuration Files\](/configuration/sharing#extending-configuration-files). Keep only one of those files in the repository. When a pull request against the default branch adds or modifies one of them and that would leave two or more in place, Mergify does not evaluate the pull request: it reports a failure listing the files it found and which one it reads. ## File Format The configuration file uses the \[YAML\](https://yaml.org/) format. The file's main type is a dictionary and each key of the dictionary configures a different aspect of Mergify: {/\* FIXME: add link to a better page than writing your first rule? \*/} - \[\`pull\_request\_rules\`\](#pull-request-rules) configures \[Workflow Automation\](/workflow/); - \[\`merge\_protections\`\](#merge-protections) and \[\`merge\_protections\_settings\`\](#merge-protections) configures \[Merge Protections\](/merge-protections/); - \[\`queue\_rules\`\](#queue-rules) configures the \[Merge Queue\](/merge-queue); - \[\`merge\_queue\`\](#merge-queue) configures options for the \[Merge Queue\](/merge-queue); - \[\`priority\_rules\`\](#priority-rules) configures the \[priorities for the Merge Queue\](/merge-queue/priority); - \[\`scopes\`\](/merge-queue/scopes) configures Merge Queue scopes; - \[\`commands\_restrictions\`\](/commands/restrictions) configures who is able to run commands; - \[\`defaults\`\](#defaults) lets you configure default options for various actions; - \[\`shared\`\](#shared) lets you \[define any YAML payload that can be used using YAML anchors\](/configuration/sharing#sharing-configuration-sections); - \[\`extends\`\](#extends) lets you \[extend the configuration\](/configuration/sharing#extending-configuration-files) file by importing another configuration file. ### Pull Request Rules The top-level key \`pull\_request\_rules\` lets you automate your workflow by writing rules that execute actions. It must be a list of dictionaries with the following keys: | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`actions\` | Actions | | The actions to perform when the rule matches. | | \`conditions\` | List of conditions | | The conditions that must be met for the rule to be evaluated. | | \`description\` | string or null | \`null\` | A description of the rule. | | \`disabled\` | DisabledDict or null | \`null\` | If the rule is disabled, the reason why it's disabled. | | \`name\` | string | | The name of the rule. This is used when reporting information about a rule. It's not possible to have two rules with the same name. | Example: \`\`\`yaml pull\_request\_rules: - name: add label when author is jd description: jd needs his own label because reasons conditions: - author = jd actions: label: add: - jd \`\`\` ### Merge Protections The top-level key \`merge\_protections\` lets you protect your merge by adding a list of rules that must match before allowing the pull request to be merged. | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`description\` | string or null | \`null\` | A description of the rule | | \`if\` | List of conditions | | The conditions to check before applying the rule | | \`name\` | string | | The name of the rule | | \`success\_conditions\` | List of conditions | | The conditions to check to validate the rule | The top-level key \`merge\_protections\_settings\` lets you configure the behavior of Merge Protections. | Key name | Value type | Default | Description | Status | | --- | --- | --- | --- | --- | | \`auto\_merge\` | boolean | \`false\` | Automatically merge or queue PRs when all merge protection conditions pass. Deprecated: use auto\_merge\_conditions. | deprecated | | \`auto\_merge\_conditions\` | List of conditions or null | \`null\` | Conditions that gate auto-merge. Accepts \`true\` as shorthand for unconditional auto-merge, or a list of conditions to restrict the audience. Omit the field to disable auto-merge. | | | \`post\_comment\` | boolean | \`true\` | Whether to post merge protection status comments on pull requests | | | \`reporting\_method\` | \`check-runs\` or \`deployments\` | \`"check-runs"\` | The merge protection reporting method | | ### Merge Queue The top-level key \`merge\_queue\` lets you configure certain aspects of the \[merge queue\](/merge-queue). | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`checking\_label\` | string or null | \`null\` | The label to add on pull requests while the merge queue is checking them, from the moment they enter a batch until they leave the queue. It stays on a pull request parked in a bisection, whose own CI has not started yet. | | \`dequeued\_label\` | string or null | \`"dequeued"\` | The label to add on pull requests when they are removed from the merge queue. | | \`max\_parallel\_checks\` | integer | \`5\` | The maximum number of speculative checks allowed to run at the same time. Setting this value to 1 disables speculative checks. | | \`mode\` | \`serial\` or \`parallel\` or \`isolated\` | \`"serial"\` | Defines how the merge queue schedules pull requests. - \`serial\`: PRs are tested cumulatively. - \`parallel\`: PRs whose scopes don't overlap are tested in parallel. - \`isolated\`: PRs are grouped into batches by changed-files similarity; each batch runs as a fully isolated batch, with no dependency on any other batch. | | \`queue\_controls\_comment\` | boolean | \`true\` | When enabled, Mergify renders task-list checkboxes a developer can tick instead of typing \`@mergifyio queue\`. The two controls live in different comments. - \`Queue this pull request\`: a comment of its own, posted before the pull request is queued. - \`Requeue this pull request\`: part of the Merge Queue status comment, after the pull request has left the queue, unless the queue merged it. | | \`queued\_label\` | string or null | \`"queued"\` | The label to add on pull requests when they are added to the merge queue. | | \`reset\_on\_external\_merge\` | \`never\` or \`always\` | \`"always"\` | Defines the behavior of the merge queue when something is merged outside of the queue. "always": The queue is reset when an external merge is detected. All queued pull requests are re-evaluated to ensure correctness based on the new base branch state. "never": The queue remains unchanged. It does not reset or re-evaluate based on the external merge. | | \`skip\_intermediate\_results\` | boolean | \`false\` | Allow PRs to merge even if their own speculative check fails, as long as a later downstream check including them passes and schedule conditions are valid. | | \`status\_comments\` | \`all\` or \`outcomes\` or \`none\` | \`"all"\` | Controls the level of status comments posted on pull requests in the queue. - \`all\`: Post comments for all queue events (entering queue, CI progress, outcomes). - \`outcomes\`: Only post comments for final outcomes (merged or dequeued with failure reason). - \`none\`: Do not post any comments for queue status. | ### Queue Rules The top-level key \`queue\_rules\` lets you define the rules that reign over your \[merge queue\](/merge-queue). | Key name | Value type | Default | Description | Status | | --- | --- | --- | --- | --- | | \`allow\_inplace\_checks\` | boolean | \`true\` | Deprecated: this value is computed automatically. In-place checks are enabled only when: - \`max\_parallel\_checks == 1\` - every queue has \`batch\_size == 1\` - every queue CI is single-step (no extra \`merge\_conditions\`; either empty or identical to \`queue\_conditions\`) | deprecated | | \`allow\_queue\_branch\_edit\` | boolean | \`false\` | Deprecated: this option is being removed after 2026-12-31, and there is no replacement. Move the work now done on a batch branch onto the pull requests themselves. Once the option is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is the behaviour you get today by leaving this unset. When creating a branch for a queue, if the commits of this branch are edited by an entity external to Mergify, Mergify dequeues all pull requests embarked in the branch and report the issue as a failure. If set to \`true\`, Mergify will allow such modifications and trust the content of the branch. Make sure only Mergify and your external application are allowed to edit these branches. This option requires \`merge\_method\` to be \`merge-batch\` or \`fast-forward\`. Those two merge the batch branch itself, so a commit pushed to it is part of what lands on the base branch; \`merge\`, \`squash\` and \`rebase\` merge each pull request at its own head, which never includes the edit. Enabling it therefore means the merged content is the batch branch, including commits that were never reviewed as part of any pull request. That is the contract of this option: it exists for batch-level work (a conflict resolution, a migration reorder, a lockfile regeneration) that belongs to no single pull request. Note also that under these two merge methods Mergify does not merge the pull requests one by one: GitHub marks each embarked pull request as merged only when its head commit is reachable from the new base branch tip, so a pull request whose head no longer matches what was embarked is not shown as merged even though its content landed. | | | \`autoqueue\` | boolean | \`false\` | When set to true, automatically add a pull request to the queue when it matches the queue conditions. When false, the pull request must be manually queued. Deprecated: use merge\_protection\_settings.auto\_merge\_conditions instead. | deprecated | | \`batch\_max\_failure\_resolution\_attempts\` | integer or null | \`null\` | The number of attempts to resolve a batch failure before dequeueing pull requests. By default, Mergify will attempt to resolve a batch failure by splitting the batch multiple times until it finds the root cause of the failure. You can stop this process earlier by limiting the number of resolution attempts. Setting this to 0 will dequeue all the pull requests from a batch when a batch fails. | | | \`batch\_max\_wait\_time\` | duration | \`"30 seconds"\` | The maximum amount of time to wait for additional pull requests before processing a batch that hasn't reached \`batch\_size\`. The timer starts when the first pull request enters the batch. If \`batch\_size\` is reached before this time expires, the batch processes immediately. This does not enforce a minimum delay between batches. | | | \`batch\_size\` | integer or \`{min, max}\` | \`1\` | The number of pull requests per speculative check in the queue. Either a single integer (fixed size, 1-128) or an object \`{min, max}\` for dynamic batching: the queue uses \`min\` when parallel-check slots are plentiful and grows toward \`max\` to keep the backlog at zero. | | | \`branch\_protection\_injection\_mode\` | \`queue\` or \`merge\` or \`none\` | \`"queue"\` | Branch protections conditions injection mode to use. - \`queue\` will inject branch protections conditions as required conditions for queuing and merging pull requests. - \`merge\` will inject branch protections conditions as required conditions only for merging pull requests. - \`none\` will not inject them at all, and requires a \`merge\_bot\_account\` able to satisfy the protections itself. | | | \`checks\_timeout\` | duration or \`auto\` or null | \`"auto"\` | The amount of time the merge queue waits for pending checks to return before dequeueing pull requests. This cannot be less than 60 seconds. Defaults to \`auto\`, which lets Mergify compute the timeout from the recent CI runtime of this queue (the 95th-percentile runtime with a safety margin). Runs identified as retry reruns or bisection runs are excluded from the calibration; runs whose provenance predates this tracking are kept for compatibility. \`auto\` applies no timeout until enough history has been gathered. Set to \`null\` to disable the checks timeout entirely. | | | \`commit\_message\_format\` | CommitMessageFormatModel or null | \`null\` | Declarative commit message format configuration. Use this instead of the Jinja2 \`commit\_message\_template\` for the common merge-commit shapes. Mutually exclusive with \`commit\_message\_template\` on the same rule. | | | \`commit\_message\_template\` | template or null | \`null\` | Template to use as the commit message when using the merge or squash merge method. Deprecated: use \`commit\_message\_format\` instead. | deprecated | | \`conflict\_resolvers\` | list of ConflictResolverModel | | Resolve conflicts on the files you name while Mergify builds a batch, instead of removing the pull request that conflicts from it. When several entries match a file, the last one wins. Only takes effect when the batch branch Mergify built is what lands: \`merge\_method\` set to \`merge-batch\` or \`fast-forward\`, or \`queue\_branch\_merge\_method\` set to \`fast-forward\`. Otherwise \`merge\`, \`squash\` and \`rebase\` merge each pull request on its own, so a resolution made while building the batch would never land. | | | \`draft\_bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to create its draft pull requests. If no \`draft\_bot\_account\` is set, Mergify creates the draft pull request itself. The user account must have already been logged in Mergify dashboard once and have admin, write or maintain permission. | | | \`max\_checks\_retries\` | integer | \`0\` | Number of times Mergify will retry failed CI checks before removing the pull request from the queue. On each retry, the draft pull request is recreated to trigger a fresh CI run. This is useful for handling flaky CI. When set to a value greater than 0, in-place checks are disabled and a draft pull request is always created. Set to 0 (default) to disable retries. | | | \`merge\_bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to merge pull requests. If no \`merge\_bot\_account\` is set, Mergify merges the pull request itself. The user account \*\*must\*\* have already been logged in Mergify dashboard once and have \*\*write\*\* or \*\*maintain\*\* permission. | | | \`merge\_conditions\` | List of conditions | | The list of conditions to match to get the queued pull request merged. In case of draft pull request, the merge conditions for checks are evaluated against the temporary pull request instead of the original one. | | | \`merge\_method\` | \`merge\` or \`rebase\` or \`squash\` or \`fast-forward\` or \`merge-batch\` or null | \`null\` | Merge method to use. If no value is set, Mergify uses the first authorized method available in the repository configuration. Additionally, \`merge-batch\` merges the draft pull request prepared by the merge queue using a merge commit. This requires \`batch\_size > 1\`. | | | \`name\` | string | | Name of the queue rule. | | | \`queue\_branch\_merge\_method\` | \`fast-forward\` or null | \`null\` | Deprecated spelling of \`merge\_method: fast-forward\`. If set to \`fast-forward\`, Mergify moves the base branch onto the draft pull request instead of merging the original pull request that has been checked, whatever \`merge\_method\` is set to. Use \`merge\_method: fast-forward\` instead. | deprecated | | \`queue\_branch\_prefix\` | string | \`"mergify/merge-queue/"\` | Prefix for the merge queue branch name. It must start valid git branch names, and cannot start with \`refs/\`, which GitHub refuses. Branches under this prefix are eligible for automatic \[queue branch cleanup\](https://docs.mergify.com/merge-queue/lifecycle#queue-branch-cleanup). | | | \`queue\_conditions\` | List of conditions | | The list of conditions that needs to match to queue the pull request. | | | \`update\_bot\_account\` | simple-template or null | \`null\` | For certain actions, such as rebasing branches, Mergify has to impersonate a GitHub user. You can specify the account to use with this option. With no \`update\_bot\_account\`, the update goes through GitHub's API as Mergify and impersonates nobody. The user account \*\*must\*\* have already been logged in Mergify dashboard once. This option overrides the value defined in the queue rules section of the configuration. \*\*Warning:\*\* With \`update\_method: rebase\` and checks run in place, a pull request coming from a fork cannot be rebased on behalf of this account: GitHub refuses an OAuth token on its rebase API for a fork, so it would mean impersonating the account to force-push the contributor's branch. Those pull requests are refused when they are queued. Unset this option to rebase them through GitHub's API as Mergify instead -- except for a fork pull request that changes GitHub Actions workflows or was opened by another App's bot, which GitHub lets Mergify queue in place only \*with\* an \`update\_bot\_account\`, or that changes more files than GitHub lists, which Mergify cannot rule out as a workflow change; such a queue has to run its checks on a draft pull request. Or set \`update\_method: merge\` on a queue that does not merge with \`fast-forward\`: such a queue lands by moving the base branch onto this one, so a merge commit is what it exists to keep off it, and it has to run its checks on a draft pull request instead. | | | \`update\_method\` | \`rebase\` or \`merge\` or null | \`null\` | Method to use to update the pull request with its base branch when the check is done in place. Possible values: - \`merge\` to merge the base branch into the pull request. - \`rebase\` to rebase the pull request against its base branch. When the queue runs its checks in place, a pull request coming from a fork cannot be rebased on behalf of an \`update\_bot\_account\` and is refused -- see that option for the remedy. Without an \`update\_bot\_account\`, the rebase goes through GitHub's API as Mergify, which works on a fork -- except for one that changes GitHub Actions workflows or was opened by another App's bot, which GitHub lets Mergify queue in place only \*with\* an \`update\_bot\_account\`, or one that changes more files than GitHub lists, which Mergify cannot rule out as a workflow change. Such a queue has to run its checks on a draft pull request instead. When \`null\`, defaults to \`merge\` except if \`merge\_method\` is \`fast-forward\` then it defaults to \`rebase\`. | | ### Priority Rules The top-level key \`priority\_rules\` lets you define the rules that will determine which \[priority\](/merge-queue/priority) a pull request has when entering your merge queue. | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`allow\_checks\_interruption\` | boolean | \`false\` | Allow interrupting the ongoing checks when the pull request entering the queue has a higher priority than the queued one(s). If set to false, a pull request with higher priority will be inserted just after the pull requests that have checks running. | | \`conditions\` | List of conditions | | The list of conditions that needs to match to assign priority to the pull request. | | \`name\` | string | | Name of the rule. | | \`priority\` | \[Priority\](/configuration/data-types#priority) | \`"medium"\` | The priority of the pull request. | ### Defaults The \`defaults\` section provides a means to set configuration values that act as fallbacks for: - Actions executed by both \[pull request rules\](/workflow/) and \[commands\](/commands) - Configuration options for \[queue rules\](/merge-queue/) Instead of defining the same options repeatedly for different rules, you can specify them once in the defaults section. If a particular option is directly defined under \`pull\_request\_rules\` or \`queue\_rules\`, it will take precedence; otherwise, the system resorts to the values defined in the \`defaults\` section. \`\`\`yaml defaults: actions: comment: bot\_account: Autobot queue\_rule: batch\_size: 10 pull\_request\_rules: - name: comment with default conditions: - label = comment actions: comment: message: I 💙 Mergify queue\_rules: - name: default - name: default with smaller batch batch\_size: 2 \`\`\` This configuration is equivalent to: \`\`\`yaml pull\_request\_rules: - name: comment with default conditions: - label = comment actions: comment: message: I 💙 Mergify bot\_account: Autobot queue\_rules: - name: default batch\_size: 10 - name: default with smaller batch batch\_size: 2 \`\`\` In the example, the \`bot\_account\` value is taken from the \`defaults\` section, simplifying the \`pull\_request\_rules\` and ensuring consistent behavior across different rules. The same behavior applies for the \`batch\_size\` option of the \`queue\_rules\`, the default value of \`10\` gets applied to the queue rule \`default\` but not for the queue rule \`default with smaller batch\`, because it already has \`batch\_size: 2\`. ### Shared You can store anything in the \`shared\` key. Its main purpose is to provide a place to put redundant YAML anchors. See \[Sharing\](/configuration/sharing#sharing-configuration-sections). ### Extends Mergify offers a feature to extend your configuration file by incorporating settings from another repository, aiding in consistency and reducing duplication. This is achieved by using the \`extends\` keyword at the top of your configuration file and specifying the source repository. See \[Extending Configuration Files\](/configuration/sharing#extending-configuration-files). ## JSON Schema Specification A machine-readable description of the Mergify configuration file format is available as a \[JSON Schema\](https://json-schema.org/) specification. You can use it to validate configuration files or power editor completion. You can find the JSON Schema specification for the Mergify configuration here. ## Validation and Troubleshooting Mergify validates your configuration on every push. This section covers how to check your configuration file and track down problems. ### Validation To validate your Mergify configuration file, you can use Mergify's built-in validation tool. Whenever you push a change to the configuration file, Mergify will automatically validate the configuration and report any errors or warnings in the "Checks" tab of your pull request. ![Mergify configuration check](https://docs.mergify.com/configuration/%7BconfigCheckScreenshot%7D) If there are any issues with your configuration file, you will receive a detailed description of the problem and guidance on how to fix it. ### Sections That Are Never Used Each product reads its own sections of the configuration, and it only reads them where that product is enabled on the repository. A configuration that defines \`pull\_request\_rules\` without \[Workflow Automation\](/workflow/), \`queue\_rules\`, \`priority\_rules\` or \`merge\_queue\` without the \[Merge Queue\](/merge-queue), or \`merge\_protections\` without \[Merge Protections\](/merge-protections/) is valid, and those sections are never evaluated. The configuration check run stays green, since the file really is valid, and it reports which sections will not be used and which product each one is waiting on, with a link to enable it. The \[simulate command\](#simulate) reports the same thing, so you can see it before pushing. No other top-level section is gated on a product this way, so none of them is ever reported. \`scopes\`, \`shared\`, \`extends\`, \`commands\_restrictions\` and \`defaults\` are read whatever is enabled, even where what they configure belongs to one product, and so is \`merge\_protections\_settings\`, some of which applies outside Merge Protections. ### Validate Locally With Pre-Commit To catch issues before pushing, you can validate your configuration locally using \[Mergify's pre-commit hook\](https://github.com/Mergifyio/mergify-pre-commit). Add this to your \`.pre-commit-config.yaml\`: \`\`\`yaml repos: - repo: https://github.com/Mergifyio/mergify-pre-commit rev: 1.0.0 hooks: - id: validate-mergify-config \`\`\` ### Troubleshooting If you encounter issues or unexpected behavior with your Mergify configuration file, consider the following troubleshooting steps: 1. Double-check the file name and location: ensure that your configuration file is correctly named (e.g., \`.mergify.yml\`) and is located in the right place. See \[Configuration File Name\](#configuration-file-name) for details. 2. Verify the YAML syntax: confirm that your configuration file follows the proper YAML syntax, including correct indentation, spacing, and structure. 3. Review your rules and conditions: Make sure that your rules and conditions are correctly defined and accurately reflect your intended workflow. 4. Check for conflicting rules: examine your rules for any conflicts or overlapping conditions that could cause unintended behavior. 5. Consult Mergify's documentation: refer to Mergify's documentation for guidance on creating and managing your configuration file, as well as understanding the various features and options available to you. ## Validating with the CLI The \[Mergify CLI\](/cli/config) 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 detects the configuration file on its own, or reads the path you give it with \`--config-file\`. ### 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. --- # Unknown \--- title: Integrating Dependabot with Mergify description: How to automate your dependencies update using Mergify. --- \[Dependabot\](https://github.com/features/security) helps you keep your dependencies up-to-date by automatically opening pull requests for outdated dependencies. When combined with Mergify, you can automate more of the process. ## Automating Dependabot Pull Request Merges If you have GitHub's branch protection set up to require approvals, you can use Mergify to automatically approve Dependabot PRs. \`\`\`yaml pull\_request\_rules: - name: Automatically approve Dependabot PRs conditions: - author = dependabot\[bot\] actions: review: type: APPROVE \`\`\` ## Filtering Dependabot PRs Mergify exposes condition attributes describing each Dependabot update: \`dependabot-dependency-name\`, \`dependabot-dependency-type\`, and \`dependabot-update-type\`. You can use these in your \[merge protection\](/merge-protections/custom-rules) conditions to filter which Dependabot PRs are allowed to merge. For instance, you might want to block major version bumps: \`\`\`yaml merge\_protections: - name: block-major-dependabot-updates if: - author = dependabot\[bot\] success\_conditions: - dependabot-update-type != version-update:semver-major \`\`\` ## Batching Dependency Updates For projects where there are frequent updates to a large number of small libraries, you can batch these updates together. Using Mergify's merge queue feature, you can automatically batch and test these updates together, reducing CI load and ensuring compatibility. For example, you could set up a merge queue to batch those PRs 10 by 10: \`\`\`yaml queue\_rules: - name: dep-update batch\_size: 10 # Wait for up to 30 minutes for the batch to fill up batch\_max\_wait\_time: 30 min queue\_conditions: - author = dependabot\[bot\] \`\`\` ## Disable Dependabot's Automatic Rebase By default, Dependabot will try to rebase its pull requests every time there's a new commit to the main branch. In high-velocity projects with a lot of updates, this can lead to unnecessary CI runs. It's recommended to disable Dependabot's automatic rebase feature and instead rely on Mergify to queue and merge these updates efficiently. To disable automatic rebasing in Dependabot, use the \[\`rebase-strategy\`\](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#rebase-strategy) settings and turn off automatic rebase. \`\`\`yaml version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "weekly" # Disable rebasing for npm pull requests rebase-strategy: "disabled" \`\`\` ## Configuring \`MERGIFY\_TOKEN\` for Dependabot If you use Mergify features that require a \`MERGIFY\_TOKEN\` in your GitHub Actions workflows, such as \[CI Insights\](/ci-insights/setup/github-actions) or \[Scopes\](/merge-queue/scopes), you need to add the token to your \*\*Dependabot secrets\*\* in addition to your regular GitHub Actions secrets. Dependabot workflows run in a restricted environment and \*\*cannot access regular GitHub Actions secrets\*\*. Without this extra step, any workflow triggered by a Dependabot pull request will fail to authenticate with the Mergify API. To configure it: 1. Go to your repository \*\*Settings → Secrets and variables → Dependabot\*\*. 2. Click \*\*New repository secret\*\*. 3. Set the name to \`MERGIFY\_TOKEN\` and paste the same application key you use in your GitHub Actions secrets. :::note This applies to any workflow that references \`${{secrets.MERGIFY\_TOKEN}}\` and runs on Dependabot pull requests, including scopes detection, CI Insights test uploads, and any other Mergify CI integration. ::: --- # Unknown \--- title: Mergify Conditions description: Everything you need to know when writing conditions in Mergify --- A condition is a boolean expression evaluated against a pull request's attributes to determine whether a rule applies. ## Structure of a Condition The grammar for a condition is: \`\[ "-" \] \[ "#" \] \[ \]\` ### Modifiers - The optional minus (\`-\`) prefix negates the condition ("not"). Time-based attributes (timestamps, \`schedule\`, and \`current-datetime\`) cannot be negated this way. - The optional hash (\`#\`) prefix evaluates the length of an attribute (for example, the number of items in a list). The \`commits-behind\` attribute is only available in this counted form and always requires the \`#\` prefix. ### Attributes Attributes represent properties of a pull request: number of approvals, labels, status of CI checks, and so on. The \`scope\` attribute holds the list of \[scopes\](/merge-queue/scopes) associated with the pull request, so you can match conditions against them. ### Operators When the attribute is a list, comparison operators behave as if "any" is used on the list: the condition is true if any element matches. \`\`\`yaml # True if any check named \`test\` succeeds. - check-success = test # True if any modified file starts with foo/ - files ~= ^foo/ \`\`\` ### Values Values can be strings, numbers, or Booleans, depending on the attribute. For example: \`#approved-reviews-by >= 2\` - Attribute: \`approved-reviews-by\` (list of approved reviewers). - Operator: \`>=\`. - Value: \`2\`. - The \`#\` prefix evaluates the length of the list. Boolean attributes are used on their own or negated with \`-\`: \`\`\`yaml # True if the PR is merged - merged # True if the PR is open - -closed \`\`\` ### Matching the Pull Request Author Use \`{{ author }}\` as a value to match an attribute against the pull request's author. Mergify resolves it to the author's login rather than rendering it as a template. It is accepted wherever a text value is expected (logins, branches, labels, check names), but not by numeric, timestamp or Boolean attributes, which reject it as an invalid value. \`\`\`yaml # True if the command sender is the pull request author # (\`sender\` is only available in \`commands\_restrictions\`) - sender = {{ author }} # True if a commit is authored by the pull request author - commits\[\*\].author = {{ author }} \`\`\` ## Attributes List Conditions are evaluated against the following pull request attributes, split into Mergify attributes and a read-only set loaded from GitHub. ### Mergify Attributes | Attribute name | Value type | Description | | --- | --- | --- | | \`added-files\` | list of string | The files that are added by the pull request, including the destination of a renamed file. | | \`added-lines\` | list of string | The lines that are added by the pull request. Only usable as \`#added-lines\` for the number of added lines. | | \`approved-reviews-by\` | list of string | The list of GitHub user or team login that approved the pull request. Team logins are prefixed with the \`@\` character and must belong to the repository organization. This only matches reviewers with \`admin\`, \`write\` or \`maintain\` permission on the repository. | | \`assignee\` | list of string | The list of GitHub user or team login that are assigned to the pull request. Team logins are prefixed with the \`@\` character and must belong to the repository organization. | | \`author\` | string | The GitHub user or team login of the author of the pull request. | | \`base\` | string | The name of the branch the pull request should be pulled into. | | \`body\` | string | The content of the pull request description without Markdown/HTML comments. | | \`body-raw\` | string | The content of the pull request description. | | \`changes-requested-reviews-by\` | list of string | The list of GitHub user or team login that have requested changes in a review for the pull request. | | \`check\` | list of string | The list of checks for that pull request. | | \`check-cancelled\` | list of string | The list of checks that were cancelled for the pull request. Cancelled checks are also matched by \`check-failure\`; use \`check-cancelled\` to address them independently. | | \`check-failure\` | list of string | The list of checks that failed for the pull request. Checks that report being cancelled, timed out, and action required are also considered as failures. | | \`check-neutral\` | list of string | The list of checks that are neutral for the pull request. | | \`check-pending\` | list of string | The list of checks that are pending for the pull request. | | \`check-skipped\` | list of string | The list of checks that was skipped for the pull request. | | \`check-stale\` | list of string | The list of checks that are stale for the pull request. | | \`check-success\` | list of string | The list of checks that successfully passed for the pull request. | | \`check-timed-out\` | list of string | The list of checks that timed out for the pull request. | | \`closed\` | boolean | Whether the pull request is closed. | | \`closed-at\` | date-time or null | The time the pull request was closed at. | | \`co-authors\` | list of CommitAuthor | The list of co-authors on the pull request (excluding merge commits and bots). | | \`commented-reviews-by\` | list of string | The list of GitHub user that have commented in a review for the pull request. This only matches reviewers with \`admin\`, \`write\` or \`maintain\` permission on the repository. | | \`commits\` | list of Commit | The list of commits of the pull request. The index 0 is the first commit, while -1 is the last commit. | | \`commits-behind\` | list of string | The list of commits between the head of the base branch and the base of the pull request. This can only be used with the length operator as \`#commits-behind\`. | | \`commits-unverified\` | list of string | The list of commit messages that are marked as unverified by GitHub. | | \`conflict\` | boolean | Whether the pull request is conflicting with its base branch. | | \`created-at\` | date-time | The time the pull request was created at. | | \`current-datetime\` | date-time | The current date and time. | | \`deleted-lines\` | list of string | The lines that are deleted by the pull request. Only usable as \`#deleted-lines\` for the number of deleted lines. | | \`dependabot-dependency-name\` | list of string | The dependency-name value included in the Dependabot commit message. | | \`dependabot-dependency-type\` | list of string | The dependency-type value included in the Dependabot commit message. | | \`dependabot-update-type\` | list of string | The update-type value included in the Dependabot commit message. | | \`depends-on\` | list of string | The list of dependencies to other pull request in the format \`owner/repo#prnumber\`. | | \`deployment-failure\` | list of string | The list of environments whose deployment failed for the pull request. A deployment published by a GitHub App is also matched by its qualified \`@/\` form. | | \`deployment-success\` | list of string | The list of environments successfully deployed for the pull request. A deployment published by a GitHub App is also matched by its qualified \`@/\` form. | | \`dismissed-reviews-by\` | list of string | The list of GitHub user login that have their review dismissed in the pull request. | | \`draft\` | boolean | Whether the pull request is in draft state. | | \`files\` | list of string | The files that are modified, deleted or added by the pull request. A renamed file counts at both of its paths, so it appears twice; \`#files\` reports GitHub's own changed-file count, which counts it once. | | \`from-fork\` | boolean | Whether the pull request comes from a fork, i.e. its head branch and its base branch live in different repositories. Also \`true\` when the head repository has been deleted, since a deleted repository is never the one holding the base branch. | | \`head\` | string | The name of the branch where the pull request changes are implemented. | | \`head-repo-full-name\` | string | The head branch repository full name (complete version with the organization name). | | \`label\` | list of string | The list of labels of the pull request. | | \`linear-history\` | boolean | Whether the pull request commits history is linear (no merge commit). | | \`locked\` | boolean | Whether the pull request is locked. | | \`merge-commit-sha\` | string or null | The merge commit SHA of the pull request returned by GitHub. | | \`merged\` | boolean | Whether the pull request is merged. | | \`merged-at\` | date-time or null | The time the pull request was merged at. | | \`merged-by\` | string or null | The GitHub user that merged the pull request. | | \`mergify-configuration-changed\` | boolean | Whether the pull request contains changes in the configuration file. | | \`milestone\` | string or null | The milestone title associated to the pull request. | | \`modified-files\` | list of string | The files that are modified in place by the pull request. A renamed file is not modified: it is removed at its previous path and added at its new one. | | \`modified-lines\` | list of string | The lines that are modified by the pull request. Only usable as \`#modified-lines\` for the number of modified lines. | | \`number\` | integer | The pull request number. | | \`queue-dequeue-reason\` | \[Queue dequeue reason\](/configuration/data-types#queue-dequeue-reason) | The code identifying why a pull request's merge queue checks ended — the pull request may have left the queue, or had its checks interrupted while staying in the queue. | | \`queue-merge-started-at\` | date-time or null | The time the pull request mergeability checks have started at. | | \`queue-name\` | string or null | The name of the queue containing the pull request. | | \`queue-position\` | integer | The position of the pull request in its queue if queued. The first pull request in the queue has position 0. The value is set to -1 if the pull request is not queued. | | \`queued-at\` | date-time or null | The time the pull request was queued at for merge. | | \`removed-files\` | list of string | The files that are removed by the pull request, including the previous path of a renamed file. | | \`repository-full-name\` | string | The current repository full name (complete version with the organization name). | | \`repository-name\` | string | The current repository name (short version without the organization name). | | \`review-requested\` | list of string | The list of GitHub user or team login that were requested to review the pull request. Team logins are prefixed with the @ character. This only matches reviewers with \`admin\`, \`write\` or \`maintain\` permission on the repository. | | \`review-threads-resolved\` | list of string | The list of ids associated to review threads that are marked as resolved by GitHub. | | \`review-threads-unresolved\` | list of string | The list of ids associated to review threads that are NOT marked as resolved by GitHub. | | \`schedule\` | \[Schedule\](/configuration/data-types#schedule) | The current time will be compared against this schedule to validate this attribute. | | \`scope\` | list of string | The list of scopes associated with the pull request for merge queue batching. With a \`files\` source, a renamed file counts at both of its paths, so moving a file out of a scope reports that scope as well as the destination's. | | \`sender\` | string | The GitHub login of the command author. | | \`sender-permission\` | GitHubRepositoryPermission | The permission of the command author. | | \`title\` | string | The title of the pull request. | | \`updated-at\` | date-time | The time the pull request was updated at. | | \`updates\` | list of PullRequestHeadShaHistoryDict | The list of updates done on an opened pull request. | #### Renamed Files A rename touches two paths. Mergify treats it the way \`git\` does with rename detection turned off: the file is \*\*removed\*\* at its previous path and \*\*added\*\* at its new one. For \`git mv critical/guard.txt ignored/guard.txt\`: - \`files\` contains both \`critical/guard.txt\` and \`ignored/guard.txt\` - \`removed-files\` contains \`critical/guard.txt\` - \`added-files\` contains \`ignored/guard.txt\` - \`modified-files\` contains neither, even when the move also changed the file's content - \`scope\` reports the scopes owning both paths So \`removed-files ~= ^critical/\` matches a pull request that moves a file out of \`critical/\`, and a \`-files ~= ^critical/\` gate is not satisfied by one. \`#files\` is GitHub's own changed-file count, which counts a renamed file \*\*once\*\*. It therefore does not equal the length of \`files\` on a pull request containing a rename. ### GitHub Rulesets and Branch Protection Attributes Mergify derives these attributes from the GitHub rulesets and branch protection rules active on the pull request's base branch. It evaluates them itself: when a ruleset requires code owner review, last-push approval, or reviews from specific teams or users, Mergify \[injects the matching condition\](/merge-queue/github-rulesets) into the rules it evaluates and shows it in the check summary. Apart from \`github-review-decision\`, they cannot be written in your own conditions: a configuration using one is rejected with an error saying the attribute is evaluated internally by Mergify. They are documented here because you will see them in the conditions Mergify reports. | Attribute name | Value type | Description | | --- | --- | --- | | \`github-code-owner-review-satisfied\` | boolean | Whether every file the pull request touches that is owned in the repository's \`CODEOWNERS\` file has at least one approval from one of its owners (a user, or any member of an owning team). Mirrors GitHub's 'Require review from Code Owners', covering the case where GitHub blocks the merge on a code-owner review while \`pullRequest.reviewDecision\` is \`null\`. Returns \`true\` when there is no \`CODEOWNERS\` file or no touched file is owned, and \`false\` when an owner cannot be resolved to a GitHub login (an email address, or a team in another org). \[GitHub documentation\](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) | | \`github-require-last-push-approval\` | boolean | Whether GitHub's 'Require approval of the most recent reviewable push' is satisfied: the required number of approvals are in from reviewers other than the user who pushed the most recent commit, and approvals submitted against an earlier head no longer count. Mirrors how GitHub's \`pullRequest.reviewDecision\` evaluates the \`require\_last\_push\_approval\` branch protection / ruleset option. Returns \`true\` when no rule on the base branch requires last-push approval, and (leniently) when Mergify has not recorded the most recent push, such as pull requests opened before push tracking. \[GitHub documentation\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-pull-request-reviews-before-merging) | | \`github-require-review-from-specific-teams\` | boolean | Whether every \`required\_reviewers\` entry on the branch's active GitHub rulesets is satisfied (each named team has the requested number of approvals, each named user has approved). When the rule scopes the requirement to a subset of files via \`file\_patterns\`, the check only applies to PRs that touch a matching file. Returns \`false\` if an entry references a team or user id that cannot be resolved. \[GitHub documentation\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#required-reviewers) | | \`github-review-approved\` | boolean | Whether GitHub's effective review enforcement is satisfied: the required approvals are in and no eligible reviewer is blocking with an active 'Request changes'. When the rule requires at least one approval, this mirrors GitHub's \`pullRequest.reviewDecision\` (so a blocking review from a reviewer other than the approver is honored, unlike a bare approval count). When the rule requires a pull request with no approval count, it blocks only on a write+ reviewer's active 'Request changes'. Returns \`true\` when no rule on the base branch requires a review. \[GitHub documentation\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-pull-request-reviews-before-merging) | | \`github-review-decision\` | \`APPROVED\` or \`CHANGES\_REQUESTED\` or \`REVIEW\_REQUIRED\` or null | The review decision computed by GitHub from its \`pullRequest.reviewDecision\` field, driven by either classic branch protection or repository / organization rulesets. Typically reflects whether required approvals and \`CODEOWNERS\` reviews have been satisfied. \[GitHub documentation\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-pull-request-reviews-before-merging) | ## Operators List | Operator Name | Symbols | Description | | --- | --- | --- | | Equal | \`=\` or \`:\` | This operator checks for strict equality. If the target attribute type is a list, each element of the list is compared against the value and the condition is true if \*\*any\*\* value matches. | | Not Equal | \`!=\` or \`≠\` | This operator checks for non equality. If the target attribute type is a list, each element of the list is compared against the value and the condition is true if no value matches. | | Match | \`~=\` | This operator checks for \[regular expressions\](/configuration/data-types#regular-expressions) matching. If the target attribute type is a list, each element of the list is matched against the value and the condition is true if any value matches. | | Glob | \`\*=\` | This operator checks for matching path using \[Unix-style pathname pattern expansion\](/configuration/data-types#globs). If the target attribute type is a list, each element of the list is matched against the value and the condition is true if any value matches. | | Greater Than or Equal | \`>=\` or \`≥\` | This operator checks for the value to be greater than or equal to the provided value. It's usually used to compare against the length of a list using the \`#\` prefix. | | Greater Than | \`>\` | This operator checks for the value to be greater than the provided value. It's usually used to compare against the length of a list using the \`#\` prefix. | | Less Than or Equal | \`<=\` or \`≤\` | This operator checks for the value to be less than or equal to the provided value. It's usually used to compare against the length of a list using the \`#\` prefix. | | Less Than | \`<\` | This operator checks for the value to be less than the provided value. It's usually used to compare against the length of a list using the \`#\` prefix. | \### Operators on Lists Most \[operators\](#operators-list) iterate over list attributes and return true if \*\*any\*\* value matches. For a pull request with labels \`(bug, work-in-progress)\`: - \`label = work-in-progress\` is \*\*true\*\*. - \`label = enhancement\` is \*\*false\*\*. - \`label != work-in-progress\` is \*\*false\*\*. - \`label ~= ^work\` is \*\*true\*\*. - \`-label ~= ^work\` is \*\*false\*\* (negated with \`-\`). ### Examples with Operators \`\`\`yaml # Match a specific milestone - milestone = v1.0 # Fewer than 50 files changed - "#files <= 50" # Label is not "bug" - label != bug \`\`\` ## Qualifying Checks by GitHub App Two GitHub Apps can publish a check with the same name (for example, both a GitHub Actions workflow and a third-party CI emit a \`pep8\` check). The bare form is ambiguous in that case: \`check-success = pep8\` matches whichever app reported success. To disambiguate, prefix the check name with \`@/\`: \`@/\` - The leading \`@\` is the opt-in marker; without it, the check name is matched literally as before. - \`\` is the GitHub App slug as it appears in the check's URL on GitHub (e.g. \`github-actions\`, \`semantic-pull-request\`). - \`\` is the check name exactly as GitHub reports it. The qualified form is supported on every \`check-\*\` attribute that takes a check name: \`check-success\`, \`check-failure\`, \`check-neutral\`, \`check-skipped\`, \`check-cancelled\`, \`check-timed-out\`, \`check-pending\`, and \`check-stale\`. The bare form keeps its original meaning and continues to match a check from any app, so existing configurations do not need to change. Prefer the qualified \`@/\` form when you want a gate to match only the check published by a specific app. ### Example: Two Apps Reporting \`pep8\` When both apps publish a \`pep8\` check and you only want to gate on the one from a specific app, pin it with \`@/\`: \`\`\`yaml queue\_rules: - name: default merge\_conditions: # Require the pep8 check published by the GitHub Actions app, # not the one published by semantic-pull-request. - check-success = @github-actions/pep8 \`\`\` To require both, repeat the condition with each app slug: \`\`\`yaml queue\_rules: - name: default merge\_conditions: - check-success = @github-actions/pep8 - check-success = @semantic-pull-request/pep8 \`\`\` A value starting with \`@\` that does not match the \`@/\` shape is rejected at configuration validation time. GitHub reports which app published a check run. A commit status carries no such identity, so Mergify attributes it to the account that posted it: a status posted by a GitHub App also matches \`@/\`, while one posted by a person is reachable only through the bare form. Conditions Mergify derives from classic branch protection are reachable only through the bare form too. A \[GitHub ruleset\](/merge-queue/github-rulesets) that binds a required status check to one app is derived in the qualified form instead, so only that app's check satisfies it. ## Qualifying Deployments by GitHub App \`deployment-success\` and \`deployment-failure\` take the same qualified form, with a deployment environment in place of the check name: \`@/\` Anyone with the \`deployments: write\` permission on the repository can post a deployment status for any environment name, and two apps can deploy the same environment. The bare form matches whichever one reported most recently, so pin the app when who deployed is part of what the rule is about: \`\`\`yaml pull\_request\_rules: - name: comment once staging is live conditions: # The staging deployment published by Netlify, not one posted by hand. - deployment-success = @netlify/staging actions: comment: message: Staging is live. \`\`\` The bare form keeps matching a deployment from any source, so existing configurations do not need to change. A deployment status carries an app identity only when a GitHub App posted it with its own installation token. One created by a person is reachable only through the bare form, and so is one recorded before Mergify started keeping the identity. ## Matching Cancelled Checks The \`check-cancelled\` attribute matches checks that report a \`cancelled\` conclusion, such as a GitHub Actions job stopped by \`concurrency: cancel-in-progress\`. Cancelled checks are also matched by \`check-failure\` for backward compatibility. To keep a cancellation from triggering rules meant for genuine failures, pair \`check-failure\` with a negated \`check-cancelled\`: \`\`\`yaml # Match a genuine failure but ignore a cancellation - check-failure = test - -check-cancelled = test \`\`\` ## Combining Conditions Using Logical Operators Combine conditions with \`and\`, \`or\`, and \`not\`. ### The \`and\` Operator Conditions on separate lines within the same rule are implicitly joined by \`and\`. The \`and\` keyword can also be used explicitly to group conditions. \`\`\`yaml name: Require reviews and CI if: - base = main success\_conditions: - and: - "#approved-reviews-by >= 2" - "check-success = test job" \`\`\` ### The \`or\` Operator \`\`\`yaml name: Require reviews or passing CI if: - base = main success\_conditions: - or: - "#approved-reviews-by >= 2" - "check-success = test job" \`\`\` ### The \`not\` Operator \`not\` negates a block of conditions, typically wrapping an \`and\` or \`or\`. \`\`\`yaml name: Block merges missing requirements if: - base = main success\_conditions: - not: and: - "#approved-reviews-by >= 2" - "check-success = test job" \`\`\` ## Testing and Debugging Conditions ### Use the Mergify Configuration Editor The configuration editor evaluates your conditions against existing pull requests without triggering actions. 1. Navigate to your \[Mergify dashboard\](https://dashboard.mergify.com). 2. Select the repository you want to test. 3. Open "Config Editor". ![Mergify Configuration Editor](https://docs.mergify.com/configuration/%7BconfigEditorScreenshot%7D) ### Analyze the Mergify Checks Once your configuration is committed, Mergify evaluates conditions for each pull request. To inspect the evaluation: 1. Navigate to the "Checks" tab of the pull request. 2. Look for the "Mergify" check in the list of checks. 3. Click on "Summary" to view the detailed Mergify report. The report shows which rules were evaluated and whether each condition was met. ![Mergify Check Summary](https://docs.mergify.com/configuration/%7BcheckSummaryScreenshot%7D) --- # Unknown \--- title: Integrations description: The CI providers, monitoring, developer, dependency and infrastructure tools Mergify works with, and how to set each one up. --- ## Continuous Integration CI Insights, Job Selection, and Merge Queue Scopes on GitHub Actions. CI Insights, Job Selection, and Merge Queue Scopes on Buildkite. CI Insights via the Mergify Jenkins plugin, plus Merge Queue Scopes through the CLI. CI Insights and Merge Queue Scopes via the Mergify CLI, for CircleCI, GitLab CI, TeamCity, and others. \## Monitoring \## Developer Tools Use GitHub and Mergify together. Learn how you can use Slack and Mergify together. \## Dependency Management How to automate your dependencies update using Mergify. \## Infrastructure as Code Manage Mergify product enablement declaratively with the official Terraform provider. --- # Unknown \--- title: Assign description: Assign a pull request to a user. --- The \`assign\` action allows you to assign one or more users to a pull request when the conditions you specify are met. This can help automate the process of designating the right people to handle specific pull requests, based on your conditions. ## Parameters | Key name | Value type | Description | | --- | --- | --- | | \`add\_users\` | list of simple-template | | | \`remove\_users\` | list of simple-template | | | \`users\` | list of simple-template | | Each entry in \`users\`, \`add\_users\` or \`remove\_users\` is a \[\`User\`\](/configuration/data-types#user): a GitHub login, or the \`{{ author }}\` variable to assign the pull request to its author. \`users\` is the older form of \`add\_users\` and behaves the same way; prefer \`add\_users\` in new rules. :::caution GitHub silently ignores a login it will not accept as an assignee, such as a user with no access to the repository, and still answers the request as a success. Mergify has no failure to report, so the action succeeds and the pull request ends up without that assignee. Check that the logins you list have access to the repository. ::: When GitHub rejects the request outright rather than ignoring a login, the rule's check run reports the GitHub error and stays pending while Mergify retries on the next evaluation. The action never reports a failure. Mergify skips any login ending in \`\[bot\]\` when adding assignees, so a rule that assigns \`{{ author }}\` does nothing on a pull request opened by a bot. A login that appears in both \`add\_users\` and \`remove\_users\` cancels out: Mergify neither adds nor removes it. GitHub allows at most 10 assignees on a pull request, so \`users\` and \`add\_users\` accept up to 10 entries each. \`remove\_users\` accepts up to 40. ## Examples ### Assign Defined User Below is an example of how to use the \`assign\` action: \`\`\`yaml pull\_request\_rules: - name: assign PR to a user conditions: - "#files = 1" actions: assign: add\_users: - "username1" - "username2" \`\`\` ### Assign Pull Request Author User Below is an example of how to use the \`assign\` action to assign a pull request to its author: \`\`\`yaml pull\_request\_rules: - name: assign PR to its author conditions: - "#files = 1" actions: assign: add\_users: - "{{ author }}" \`\`\` --- # Unknown \--- title: Backport description: Copy a pull request to another branch once it is merged. --- The \`backport\` action enables you to automatically create a backport of a merged pull request. When the conditions you specify are met, Mergify will create a new pull request to merge the changes into the specified base branch. The \`backport\` action is useful for maintaining older versions of your project. It helps automate the process of applying bug fixes or other changes from the main branch to other branches. Note that in case of a conflict during the backport, Mergify will create a pull request with the conflict; you will have to resolve it manually. You can change this behaviour using the \`ignore\_conflicts\` option. :::caution Please make sure the branches specified in the backport action exist and you have the necessary access permissions. If the branch does not exist or you don't have the required permissions, the action will fail. ::: ## Parameters The \`backport\` action takes a list of branches to which the changes from the merged pull request will be backported. The branch names should be specified as strings. \`regexes\` picks destination branches by \[pattern\](/configuration/data-types#regular-expressions) instead of naming each one. Patterns are matched against the branches that exist in the repository, and each one is anchored at the start of a branch name only, so \`release-1\` also matches \`release-10\`. Setting both \`branches\` and \`regexes\` backports to the branches you named plus the branches your patterns matched. Mergify skips any login ending in \`\[bot\]\` when resolving \`assignees\`, so a rule that assigns \`{{ author }}\` leaves the backport unassigned if a bot opened the original pull request. | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`assignees\` | list of simple-template | | Users to assign the newly created pull request to. Accepts a GitHub login, or \`{{ author }}\` (the original pull request author) or \`{{ merged\_by }}\` (the user who merged it). | | \`body\` | simple-template | \`"{{ body }} * * * This is an automatic backport of pull request #{{number}} done by \[Mergify\](https://mergify.com). "\` | The pull request's body. | | \`bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to copy a pull request. If no \`bot\_account\` is set, Mergify copies the pull request itself. | | \`branches\` | list of Branch Name | | The list of branches the pull request should be copied to. | | \`ignore\_conflicts\` | boolean | \`true\` | Whether to create the pull requests even if there are conflicts when cherry-picking the commits. | | \`label\_conflicts\` | string | \`"conflicts"\` | The label to add to the created pull request if it has conflicts and \`ignore\_conflicts\` is set to \`true\`. | | \`labels\` | list of string | | The list of labels to add to the created pull requests. | | \`merge\_conflict\_style\` | \`merge\` or \`diff3\` | \`"merge"\` | Style used by git when displaying merge conflicts | | \`regexes\` | list of regex | | The list of regexes to find branches the pull request should be copied to. | | \`report\_mode\` | list of \[Report Mode\](/configuration/data-types#report-mode) | \`\["check"\]\` | Reporting modes for the action's result. Check will create a check on the pull request, and comment will post a comment on the pull request. | | \`title\` | simple-template | \`"{{ title }} (backport #{{ number }})"\` | The pull request's title. | \## Examples ### Using Labels to Backport Below is an example of how to use the \`backport\` action: \`\`\`yaml pull\_request\_rules: - name: backport patches to the release branch and assign to original author conditions: - label = backport actions: backport: branches: - "release-1.0" - "release-1.1" assignees: - "{{ author }}" \`\`\` ### Combining Automatic Merge You can also combine the \`backport\` action with other actions like \`merge\`. This can be useful in scenarios where you want to automatically backport and merge pull requests that fulfill certain conditions. Here's an example: \`\`\`yaml pull\_request\_rules: - name: backport patches to the release branch conditions: - label = backport actions: backport: branches: - "release-1.0" - "release-1.1" - name: automatically merge backport if they pass tests conditions: - author = mergify\[bot\] - head ~= ^mergify/bp/ - base ~= ^release-1\\. - check-success = continuous-integration actions: merge: method: merge \`\`\` In this configuration, a pull request is backported when it has the label \`backport\`. Then, when the backport is created and passes the check named \`continuous-integration\`, it will be automatically merged. Mergify opens each backport from a head branch named \`mergify/bp//pr-\`, which is what the \`head\` condition matches. The base of the backport is the destination branch itself. ### Including the cherry-picked commits To record which commits were cherry-picked (similar to the \`-x\` option of \`git cherry-pick\`), include their SHAs in the backport body with the \`{{ cherry\_picked\_commits }}\` variable: \`\`\`yaml pull\_request\_rules: - name: backport patches to the stable branch conditions: - label = backport actions: backport: body: | {{ body }} {{ cherry\_picked\_commits }} branches: - stable \`\`\` ### Impersonating the Original Author If you want to create a backport impersonating the original pull request author, you can configure the default \`backport\` actions parameter to use a \`bot\_account\` with the original pull request author account. \`\`\`yaml defaults: actions: backport: bot\_account: "{{ author }}" \`\`\` :::note The pull request author will need to log in to the Mergify dashboard at least once for a pull request to be created on their behalf. ::: --- # Unknown \--- title: Mergify Documentation description: Ship code faster with zero broken builds, reliable CI, and optimized monorepo workflows. suppressTitle: true --- {/\* ---------------- HERO ---------------- \*/} Mergify Documentation Stop breaking main ================== Mergify eliminates broken builds, tames flaky tests, and cuts CI waste, so your team ships with confidence. Browse all products ![Merge Queue dashboard showing a queue of pull requests being processed in parallel](https://docs.mergify.com/%7BmergeQueueHero%7D) {/\* ---------------- METRICS STRIP ---------------- \*/} {/\* -------------- PROBLEM CARDS -------------- \*/} What problem are you solving? ----------------------------- [Broken main, slow merges\ \ PRs pass CI individually but fail when merged.\ \ Merge Queue →](https://docs.mergify.com/merge-queue) [Slow, expensive CI\ \ A single flaky job means rerunning the whole pipeline, and no one can see which jobs cost the most time and money.\ \ CI Insights →](https://docs.mergify.com/ci-insights) [Flaky tests blocking PRs\ \ Tests fail randomly, forcing reruns and eroding trust in CI.\ \ Test Insights →](https://docs.mergify.com/test-insights) {/\* -------------- PRODUCTS -------------- \*/} Products -------- Parallel testing, batching, monorepo scopes, and priority rules. Pipeline and job monitoring, flaky detection, and Auto-Retry. Flaky test detection, quarantine, and test health tracking. Advanced guardrails before code lands. Stacked PR workflow for incremental changes. Rule engine and actions to automate PR workflows. Reference:{' '} [Configuration](https://docs.mergify.com/configuration/file-format) ·{' '} [Conditions](https://docs.mergify.com/configuration/conditions) ·{' '} [Commands](https://docs.mergify.com/commands) ·{' '} [API](https://docs.mergify.com/api) ·{' '} [Integrations](https://docs.mergify.com/integrations) {/\* -------------- DISCOVERY CALLOUT -------------- \*/} {/\* -------------- COMMUNITY -------------- \*/} Community --------- Share feedback, ask questions, and see what other teams build with Mergify. --- # Unknown \--- title: Comment description: Post a comment on a pull request. --- The \`comment\` action allows Mergify to post a comment on your pull request when certain conditions are met. The comment action can provide automated responses to events in your pull request workflow, based on the conditions and message you customize. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`bot\_account\` | simple-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\` | simple-template or null | \`null\` | The message to write as a comment. | \`message\` defaults to \`null\`, and a \`comment\` action without one is an invalid configuration. Set it on the action or in \[\`defaults\`\](/configuration/file-format#defaults). ## 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 in conflict 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. \`\`\` --- # Unknown \--- title: GitHub Actions (Deprecated) description: Dispatch an existing GitHub workflow in the repository. Deprecated in favor of GitHub Actions events. --- :::danger The \`github\_actions\` action is \*\*deprecated\*\* and will be removed in a future release. Start your workflows from GitHub Actions events instead. See the \[migration guide\](/workflow/actions/migrate-github-actions). ::: The \`github\_actions\` action enables Mergify to dispatch existing GitHub workflows within a repository when specified conditions are satisfied. :::note To use the \`github\_actions\` action, ensure your workflow includes the \`workflow\_dispatch\` trigger. Mergify also requires write permissions on Actions. Go to Mergify's UI to accept the permissions necessary for this action. ::: ## Parameters | Key name | Value type | Description | | --- | --- | --- | | \`workflow\` | Workflow Action | | ### Workflow Action | Key name | Value type | Description | | --- | --- | --- | | \`dispatch\` | list of Workflow Action Dispatch | The list of workflows to dispatch via the action. | ### Workflow Action Dispatch | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`inputs\` | object | | The inputs passed to your workflow execution if any. Values can be either a template, a number or a Boolean. | | \`ref\` | string or null | \`null\` | The reference to use when triggering the job. If none is passed, the default repository branch is used. | | \`workflow\` | string | | The GitHub Workflow file name with its extension (e.g. \`ci.yml\`), or the numeric workflow id. | ## Examples ### Dispatching GitHub Workflows with Inputs To dispatch three workflows named \`foo\_workflow.yaml\`, \`hello\_world\_workflow.yaml\` and \`dynamic\_workflow.yaml\` when a pull request is labeled with "dispatch", use the following rule. Here, the \`hello\_world\_workflow.yaml\` workflow accepts two inputs, which are defined as \`name\` and \`age\`. The \`dynamic\_workflow.yaml\` takes the \`author\` input, set with \[variable substitution\](/configuration/data-types#variable-substitution). \`\`\`yaml pull\_request\_rules: - name: Dispatch GitHub Actions conditions: - label = dispatch actions: github\_actions: workflow: dispatch: - workflow: foo\_workflow.yaml - workflow: hello\_world\_workflow.yaml inputs: name: steve age: 42 - workflow: dynamic\_workflow.yaml inputs: author: "{{ author }}" \`\`\` --- # Unknown \--- title: Dismiss Reviews description: Dismiss previous reviews on a pull request. --- The \`dismiss\_reviews\` action allows Mergify to automatically dismiss approving reviews, reviews requesting changes, or both. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`approved\` | list of string or boolean or \`from\_requested\_reviewers\` | \`true\` | If set to \`true\`, all the approving reviews will be removed when the pull request is updated. If set to \`false\`, nothing will be done. If set to a list, each item should be the GitHub login of a user whose review will be removed. If set to \`from\_requested\_reviewers\`, the list of requested reviewers will be used to get whose review will be removed. | | \`changes\_requested\` | list of string or boolean or \`from\_requested\_reviewers\` | \`true\` | If set to \`true\`, all the reviews requesting changes will be removed when the pull request is updated. If set to false, nothing will be done. If set to a list, each item should be the GitHub login of a user whose review will be removed. If set to \`from\_requested\_reviewers\`, the list of requested reviewers will be used to get whose review will be removed. | | \`message\` | string or null | \`null\` | Message to use when dismissing reviews. | | \`when\` | \`synchronize\` or \`always\` | \`"synchronize"\` | If set to \`synchronize\`, the action will run only if the pull request commits changed. Otherwise, it will run each time the rule matches. | \`when\` decides what counts as a trigger. With the default \`synchronize\`, the action only dismisses when someone pushes new commits, and it dismisses only the reviews submitted before that push. A push Mergify itself made, such as an \[\`update\`\](/workflow/actions/update) or a \[\`rebase\`\](/workflow/actions/rebase), is not a trigger and leaves every review in place. Set \`when\` to \`always\` to dismiss every time the rule's conditions match, whether or not the commits changed. ## Examples ### Dismiss Approvals When New Commits Are Pushed Keep approvals fresh by removing them whenever new commits are pushed, while leaving change requests in place. \`\`\`yaml pull\_request\_rules: - name: dismiss stale approvals conditions: - base = main actions: dismiss\_reviews: approved: true changes\_requested: false \`\`\` --- # Unknown \--- title: Sharing Configuration description: Learn how to share and reuse configuration pieces in your configuration. --- In Mergify, you can use features like YAML anchors and aliases, the \`shared\` key, and the \`extends\` key to reduce redundancy and keep your configuration consistent. ## YAML Anchors and Aliases \[YAML anchors (\`&\`) and aliases (\`\*\`)\](https://yaml.org/spec/1.2.2/#anchors-and-aliases) are supported in the \[configuration file\](/configuration/file-format). These allow you to reuse configuration sections. For example, you can create a list of continuous integration checks and use it in multiple sections: \`\`\`yaml queue\_rules: - name: hotfix queue\_conditions: - and: &CheckRuns - check-success = linters - check-success = unit - check-success = functional - check-success = e2e - check-success = docker - name: default queue\_conditions: - and: \*CheckRuns - schedule = Mon-Fri 09:00-17:30\[Europe/Paris\] \`\`\` ## Sharing Configuration Sections You can store anything in the \`shared\` key. Its main purpose is to provide a place to put redundant YAML anchors: \`\`\`yaml shared: my\_ci: &common\_checks - check-success = ci-one - check-success = ci-two queue\_rules: - name: hotfix queue\_conditions: - and: \*common\_checks - name: default queue\_conditions: - and: \*common\_checks - schedule = Mon-Fri 09:00-17:30\[Europe/Paris\] \`\`\` ## Extending Configuration Files Mergify lets you extend your configuration file by including the configuration from another repository. This feature is useful when you want to share and reuse configuration rules across multiple repositories, helping maintain consistency and reduce duplication. To extend a configuration file, use the \`extends\` keyword at the top level of your configuration file and specify the repository name from which you want to include the configuration. The value is the repository name on its own, not \`owner/repo\`: the repository is looked up in the same organization. \`\`\`yaml extends: shared-config \`\`\` :::caution - The Mergify application must also be installed on the source repository that you want to import the configuration from. - A configuration cannot extend itself, and the source repository's own configuration cannot use \`extends\`: only one level of extension is supported. - The source repository must be at least as visible as yours, since its configuration is displayed wherever your repository is readable. A private or internal repository can extend a public one, and a private repository can extend an internal one, but never the other way around. See GitHub's documentation on \[repository visibility\](https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories#about-repository-visibility). - Visibility is checked every time the configuration is loaded. Making your repository more visible, or the source repository less visible, breaks your configuration even though no configuration file changed. - When a pull request points \`extends\` at a repository your committed configuration does not already extend, Mergify resolves it only if the change comes from a branch of your repository or from an author with write access to it. Otherwise it declines, and the \[configuration check\](/configuration/file-format#validation) reports that the new configuration could not be validated. The target the committed configuration already extends always resolves. ::: The configuration from the specified repository will be loaded and applied before the one in the current repository. Here's an example: \`\`\`yaml extends: shared-config pull\_request\_rules: - name: additional rule specific to this repository conditions: - base = main actions: label: add: - repository-specific \`\`\` :::caution - Values in the \`shared\` key will not be merged and shared between local and remote configurations. - Values in the \[\`scopes\`\](/merge-queue/scopes) key will not be merged either: scopes defined in the extended configuration do not apply to the local configuration. - Values in the \`defaults\`, \`commands\_restrictions\`, \`merge\_queue\`, and \`merge\_protections\_settings\` keys will be merged and remote default values will apply to the local configuration, unless the same value already exists in the local configuration. - Rules in the \`pull\_request\_rules\`, \`queue\_rules\`, \`priority\_rules\` or \`merge\_protections\` section will be merged and remote default values will apply to the local configuration. A rule will not be overwritten by the extended configuration if it has the same name in both the extended and local configuration. ::: --- # Unknown \--- title: Integrating Any CI with Mergify description: Run CI Insights and Merge Queue Scopes on CircleCI, GitLab CI, TeamCity, or any CI that reports status checks to GitHub. --- Mergify works with any CI system that reports status checks to GitHub through the \[GitHub Checks API\](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks). Tools known to work this way include CircleCI, GitLab CI, TeamCity, and many others. The Mergify CLI brings CI Insights and Merge Queue Scopes to these tools without needing a dedicated plugin or action. Any status check reported to GitHub can also be referenced from your Mergify \[conditions\](/configuration/conditions) via \`check-success\`. Mergify has dedicated integration pages for \[GitHub Actions\](/integrations/gha), \[Buildkite\](/integrations/buildkite), and \[Jenkins\](/integrations/jenkins), which ship native plugins, actions, or webhook integrations. ## Prerequisites 1. Your CI system is configured to report build statuses to GitHub. 2. The \[Mergify GitHub App\](/integrations/github) is installed in your repository. ## Mergify features via the CLI - \*\*\[CI Insights\](/ci-insights)\*\*: upload test results from any CI job using the Mergify CLI (\`mergify ci junit-process\`) to detect flaky tests and get Slack notifications for CI failures. - \*\*\[Merge Queue Scopes\](/merge-queue/scopes)\*\*: run only the jobs affected by a batch when processing the merge queue, \[via the Mergify CLI\](/merge-queue/scopes/others#any-ci-mergify-cli). --- # Unknown \--- title: Configuration Data Types description: The different data types you can find in Mergify configuration file --- When using templates or conditions, data comes in different types. The data types available in the Mergify configuration file are listed below. ## Commit A commit is an object that embeds information about a \[Git commit\](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/about-commits) | Key name | Value type | Description | | --- | --- | --- | | \`author\` | string or null | Name of the author | | \`commit\_message\` | string | | | \`commit\_verification\_verified\` | boolean | Indicates if the commit has been marked as verified by GitHub | | \`committer\` | string or null | Name of the committer | | \`date\_author\` | string or null | | | \`date\_committer\` | string or null | | | \`email\_author\` | string or null | | | \`email\_committer\` | string or null | | | \`gh\_author\_login\` | string or null | GitHub login of the author | | \`parents\` | list of string | | | \`sha\` | string | | In a condition, a commit is addressed as \`commits\[\].\`, where the index is a position (\`0\` is the first commit, \`-1\` the last) or \`\*\` for any commit: \`\`\`yaml pull\_request\_rules: - name: check that commits are not too old conditions: - commits\[\*\].date\_committer < 365 days ago actions: comment: message: One of the commit is too old! \`\`\` Only a subset of the fields above can be used as a sub-attribute: \`author\`, \`committer\`, \`commit\_message\`, \`commit\_verification\_verified\`, \`date\_author\`, \`date\_committer\`, \`email\_author\` and \`email\_committer\`. Any other field is rejected when the configuration is validated. ## Commit Author | Key name | Value type | Description | | --- | --- | --- | | \`email\` | string or null | Email address of the author | | \`name\` | string or null | Name of the author | ## Globs Glob patterns are used by the \`\*=\` operator in your \[conditions\](/configuration/conditions), by \[file-pattern scopes\](/merge-queue/scopes/file-patterns), and by \[\`barrier\_files\`\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope). {/\* eslint-disable \*/} | Pattern | Description | |--------------------|-------------| | \`\*\*\` (entire segment) | Matches any number of file or directory segments, including zero. | | \`\*\` (entire segment) | Matches one file or directory segment. | | \`\*\` (part of a segment) | Matches any number of non-separator characters, including zero. | | \`?\` | Matches one non-separator character. | | \`\[seq\]\` | Matches one character in \`seq\`, where \`seq\` is a sequence of characters. Range expressions are supported; e.g., \`\[a-z\]\` matches any lowercase ASCII letter. Multiple ranges can be combined, e.g. \`\[a-zA-Z0-9\_\]\` matches any ASCII letter, digit, or underscore. | | \`\[!seq\]\` | Matches one character \*\*not\*\* in \`seq\`, where \`seq\` follows the same rules as above. | | \`{a,b}\` | Matches either \`a\` or \`b\`. See \[brace alternation\](#brace-alternation). | {/\* eslint-enable \*/} :::note For a literal match, wrap the meta-characters in brackets. For example, \`\[?\]\` matches the character \`?\`. ::: The \`\*\*\` wildcard enables recursive globbing. A few examples: | Pattern | Meaning | |----------|----------| | \`\*\*/\*\` | Any path with at least one segment. | | \`\*\*/\*.py\` | Any path with a final segment ending in \`.py\`. | | \`assets/\*\*\` | Any path starting with \`assets/\`. | | \`assets/\*\*/\*\` | Any path starting with \`assets/\`, excluding \`assets/\` itself. | ### Brace alternation A brace group matches any one of its comma-separated branches. Mergify expands the group into one pattern per branch, so \`\*\*/\*.{js,ts}\` is equivalent to listing \`\*\*/\*.js\` and \`\*\*/\*.ts\` separately: \`\`\`yaml pull\_request\_rules: - name: label frontend changes conditions: - files \*= web/\*\*/\*.{js,jsx,ts,tsx} actions: label: add: - frontend \`\`\` A pattern can contain several groups, and groups can nest. \`{a,b{c,d}}\` matches \`a\`, \`bc\` and \`bd\`, and \`{src,tests}/\*\*/\*.{py,pyi}\` covers the four combinations of directory and extension. :::caution An empty branch is dropped rather than matching nothing, so \`foo{,.txt}\` matches \`foo.txt\` but \*\*not\*\* \`foo\`. List the two patterns separately when you need both. ::: An unbalanced \`{\` or \`}\` is a configuration error, not a literal brace. Mergify rejects the configuration instead of leaving you with a pattern that silently matches nothing. To match a brace as a character, escape it as \`\\{\` or \`\\}\`, or bracket it as \`\[{\]\` or \`\[}\]\`; a literal comma inside a group is \`\\,\`. A pattern may expand to at most 128 alternatives and nest at most 32 levels deep. Beyond either limit, Mergify rejects the configuration. :::note YAML reads \`{\` at the start of a value as the beginning of a mapping, so quote a pattern that starts with a brace: \`'{src,tests}/\*\*'\`. Backslash escapes need single quotes or no quotes at all, since a double-quoted YAML string treats \`\\{\` as an invalid escape. ::: ## Regular Expressions {/\* fix links to "Operators" \*/} You can use regular expressions with matching operators in your \[conditions\](/configuration/conditions). Mergify uses \[Python regular expressions\](https://docs.python.org/3/library/re.html) to match rules. :::note You can use \[regex101\](https://regex101.com), \[PyRegex\](http://www.pyregex.com), or \[Pythex\](https://pythex.org) to test your regular expressions. ::: \`\`\`yaml pull\_request\_rules: - name: add python label if a Python file is modified conditions: - files ~= \\.py$ actions: label: add: - python - name: automatic merge for main when the title does not contain “WIP” (ignoring case) conditions: - base = main - -title ~= (?i)wip actions: merge: method: merge \`\`\` ## Schedule This format represents a schedule. It can contain only days, only times or both and can have a timezone specified with the times (for the list of available time zones, see the \[IANA format\](https://en.wikipedia.org/wiki/List\_of\_tz\_database\_time\_zones)). If no timezone is specified, it defaults to UTC. :::caution Schedule can be only used with the equality operators \`=\` and \`!=\`. ::: \`\`\`text schedule = Mon-Fri schedule = 09:00-19:00 schedule = 09:00-19:00\[America/Vancouver\] schedule != Mon-Fri 09:00-19:00\[America/Vancouver\] schedule != SAT-SUN \`\`\` ## Timestamp The timestamp format must follow the \[ISO 8601 standard\](https://en.wikipedia.org/wiki/ISO\_8601). If the timezone is missing, the timestamp is assumed to be in UTC. The supported timezones come from the \[IANA database\](https://www.iana.org/time-zones). :::caution The timestamp attributes (\`created-at\`, \`updated-at\`, \`closed-at\`, \`merged-at\`, \`queued-at\` and \`queue-merge-started-at\`) support only the ordering operators \`>=\`, \`<=\`, \`<\` and \`>\`. \`current-datetime\` also accepts \`=\` and \`!=\`, which compare it against a \[timestamp interval\](#timestamp-interval). None of them can be negated with the \`-\` prefix. ::: Supported formats: \`\`\`text 2021-04-05 2012-09-17T22:02:51 2008-09-22T14:01:54Z 2013-12-05T07:19:04-08:00 2013-12-05T07:19:04\[Europe/Paris\] \`\`\` \`\`\`yaml - name: end of life version 10.0 conditions: - base = stable/10.0 - updated-at <= 2021-04-05 actions: comment: message: | The pull request needs to be rebased after end of life of version 10.0 \`\`\` ## Timestamp Interval Mergify supports \[ISO8601 time intervals\](https://en.wikipedia.org/wiki/ISO\_8601#Time\_intervals) for some of the exposed attributes. If the timezone is missing, the timestamp is assumed to be in UTC. The supported timezones come from the \[IANA database\](https://www.iana.org/time-zones). \`\`\`text 2023-07-13T14:00/2023-07-13T16:00 2023-07-13T14:00:00.123/2023-07-13T16:00:00.123 2023-07-13T14:00Z/2023-07-13T16:00Z 2023-07-13T14:00/2023-07-13T16:00\[Europe/Paris\] \`\`\` \`\`\`yaml - name: merge except on new year day conditions: - current-datetime != 2023-01-01T00:00/2023-01-01T23:59\[Europe/Paris\] actions: merge: \`\`\` Unspecified digits can also be used for some part of the timestamp: \`\`\`text # 14:00 to 19:00 the 14th of July of every year XXXX-07-14T14:00/XXXX-07-14T19:00\[Europe/Paris\] # 14:00 to 19:00 every day of July of every year XXXX-07-XXT14:00/XXXX-07-XXT19:00\[Europe/Paris\] # 14:00 to 19:00 every day of July of 2023 2023-07-XXT14:00/XXXX-07-XXT19:00\[Europe/Paris\] # 14:00 to 19:00 every 31st day of every month of 2023 # If a month doesn't have a 31st day it will be skipped 2023-XX-31T14:00/2023-XX-31T19:00\[Europe/Paris\] # 14:00 to 19:00 every 31st day of every month of every year XXXX-XX-31T14:00/XXXX-XX-31T19:00\[Europe/Paris\] \`\`\` ## Relative Timestamp Timestamps can be expressed relative to the current date and time. The format is \`\[DD days\] \[HH hours\] \[MM minutes\] ago\`: - \`DD\`, the number of days - \`HH\`, the number of hours - \`MM\`, the number of minutes The offset is subtracted from the current time rather than rounded down to a whole day: evaluated at 14:30 UTC on the 18th of June 2020, \`updated-at >= 14 days ago\` matches pull requests updated after \`2020-06-04T14:30:00\` UTC. \`\`\`yaml - name: close stale pull request conditions: - base = main - -closed - updated-at < 14 days 3 hours 2 minutes ago actions: close: message: | This pull request looks stale. Feel free to reopen it if you think it's a mistake. \`\`\` ## Duration Duration can be expressed as \`quantity unit \[quantity unit...\]\` where quantity is a number (possibly signed) and unit is second, minute, hour, or day (abbreviations and plurals are accepted). \`\`\`text 1 day 15 hours 6 minutes 42 seconds 1 d 15 h 6 m 42 s \`\`\` ## Priority Priority values can be expressed by using an integer between 1 and 10000. You can also use those aliases: - \`low\` (1000) - \`medium\` (2000) - \`high\` (3000) \`\`\`yaml priority\_rules: - name: my hotfix priority rule conditions: - base = main - label = hotfix - check-success = linters priority: high - name: my low priority rule conditions: - base = main - label = low - check-success = linters priority: 550 \`\`\` ## Templates Some fields are rendered as templates before Mergify uses them. Most accept \*variable substitution\* (short \`{{ name }}\` placeholders filled with pull request data); a few still use the legacy \[Jinja2\](#legacy-template) language. ### Variable substitution Several fields let you insert pull request data using variables: \`\`\`text Thank you {{ author }} for your contribution! \`\`\` renders to: \`\`\`text Thank you jd for your contribution! \`\`\` when the pull request author login is \`jd\`. A variable is written as \`{{ name }}\` (surrounding spaces are optional). Every other character is kept as-is. Each templated field accepts a specific set of variables, documented as its data type below. ### Message template Used by the \[\`comment\`\](/workflow/actions/comment), \[\`review\`\](/workflow/actions/review) and \[\`close\`\](/workflow/actions/close) message fields. The \`{{ assignees }}\` and \`{{ approvers }}\` variables render as ready-to-use \`@\`-mentions for the pull request's assignees and the people who approved it. For example, the template: \`\`\`text Thanks {{ approvers }} for the review! \`\`\` renders to: \`\`\`text Thanks @alice, @bob for the review! \`\`\` when the pull request was approved by \`alice\` and \`bob\`. \### Title template Used by the \[\`copy\`\](/workflow/actions/copy) and \[\`backport\`\](/workflow/actions/backport) \`title\` field. \### Body template Used by the \[\`copy\`\](/workflow/actions/copy) and \[\`backport\`\](/workflow/actions/backport) \`body\` field. \### Workflow input template :::note The \[\`github\_actions\`\](/workflow/actions/github\_actions) action is deprecated, and so is this data type. ::: Used by the \[\`github\_actions\`\](/workflow/actions/github\_actions) workflow input values. \### User A GitHub login. You can also use the \`{{ author }}\` variable to target the pull request author. Used by the \[\`assign\`\](/workflow/actions/assign) \`users\`, \`add\_users\` and \`remove\_users\` fields. \### Assignee A GitHub login. You can also use \`{{ author }}\` (the pull request author) and \`{{ merged\_by }}\` (the user who merged the original pull request). Used by the \[\`copy\`\](/workflow/actions/copy) and \[\`backport\`\](/workflow/actions/backport) \`assignees\` field. \### Bot account A GitHub login Mergify impersonates to perform an action. You can also use the \`{{ author }}\` variable to act as the pull request author. It has to be a user account. Mergify cannot impersonate an account owned by another GitHub App, so an action fails when the login it resolves to is a bot, including when no \`bot\_account\` is set and it falls back to the pull request author or to whoever posted a command. Used by the \`bot\_account\` field of the \[\`backport\`\](/workflow/actions/backport), \[\`comment\`\](/workflow/actions/comment), \[\`copy\`\](/workflow/actions/copy), \[\`edit\`\](/workflow/actions/edit), \[\`rebase\`\](/workflow/actions/rebase), \[\`request\_reviews\`\](/workflow/actions/request\_reviews), \[\`review\`\](/workflow/actions/review), \[\`squash\`\](/workflow/actions/squash) and \[\`update\`\](/workflow/actions/update) actions, by the \[\`merge\`\](/workflow/actions/merge) action's \`merge\_bot\_account\`, and by the merge queue \`draft\_bot\_account\`, \`merge\_bot\_account\` and \`update\_bot\_account\`. \### Legacy template :::note Jinja2 is deprecated for fields that support \[variable substitution\](#variable-substitution). Accounts that installed Mergify recently never had it at all: their configuration is read as if Jinja2 did not exist, so anything beyond the variables a field lists is ordinary text there, accepted when the configuration is validated and then rendered verbatim. This applies to the hosted service only; on a self-hosted installation Jinja2 still renders whenever the account was created. ::: The template data type is a regular string that is rendered using the \[Jinja2 template language\](https://jinja.palletsprojects.com/templates/). If you don't need any of the power coming with this templating language, you can just use this as a regular string. However, those templates let you use any of the \[pull request attributes\](/configuration/conditions#attributes-list) in the final string. For example the template string: \`\`\`jinja Thank you @{{author}} for your contribution! \`\`\` will render to: \`\`\`text Thank you @jd for your contribution! \`\`\` when used in your configuration file, considering the pull request author login is \`jd\`. \[Jinja2 filters\](https://jinja.palletsprojects.com/en/3.0.x/templates/#builtin-filters) are supported, you can build string from list for example with: \`\`\`jinja Approved by: @{{ approved\_reviews\_by | join(', @') }} \`\`\` \[Jinja2 string manipulation\](https://jinja.palletsprojects.com/en/3.0.x/templates/#python-methods>) are also supported, you can split string for example with: \`\`\`jinja {{ body.split('----------')\[0\] | trim }} \`\`\` Mergify also provides custom Jinja2 filters: - \`markdownify\`: to convert HTML to Markdown: \`\`\`jinja {{ body | markdownify }} \`\`\` - \`get\_section( , )\`: to extract one Markdown section \`\`\`jinja {{ body | get\_section("## Description") }} \`\`\` :::caution You need to replace the \`-\` character by \`\_\` from the \[pull request attribute\](/configuration/conditions#attributes-list) names when using templates. The \`-\` is not a valid character for variable names in Jinja2 template. ::: :::note By default, the HTML comments are stripped from \`body\`. To get the full body, you can use the \`body\_raw\` attribute. ::: ## GitHub Repository Permissions Either \`none\`, \`read\`, \`triage\`, \`write\`, \`maintain\` or \`admin\`. ## Queue Dequeue Reason This describes the reason why a pull request's merge queue checks ended: either because the pull request left the queue, or because its checks were interrupted while it stayed in the queue. The following reasons can be reported: \## Batch Status This describes what a \[batch\](/merge-queue/batches) is currently doing in the merge queue. It is reported as the \`status.code\` field of each batch returned by the \[merge queue status API\](/api/merge-queue), and the dashboard shows it on each batch. A status describes the batch as a whole, not an individual pull request: a batch that is running its checks reports \`running\` for every pull request it carries. The following statuses can be reported: \## Report Mode Report modes allow you to choose the type of report you want for your actions. Report mode values can be expressed in the configuration as a list of strings. The default value is \`\["check"\]\` and the list can't be empty. To fill the list, the following report modes are available: | Mode | Description | | --- | --- | | `check` | Report the action's result as a GitHub check on the pull request. This is the default report mode. | | `comment` | Report the action's result as a comment on the pull request | Report mode option is currently supported for only the following actions: \[\`backport\`\](/workflow/actions/backport), \[\`copy\`\](/workflow/actions/copy). --- # Unknown \--- title: Merge Protections description: Go beyond GitHub's native branch protections and craft custom, advanced rules using Mergify. --- > Mergify Merge Protections extend GitHub's native Branch Protections & Rulesets with fine-grained, dynamic rules. Merge Protections let you: - Enforce advanced success criteria on pull requests (title patterns, labels, CI signals, file changes, authorship, etc.) - Express dependencies between pull requests (block merge until others are merged) - Schedule when merges may occur (or enforce freezes) - Provide consistent, explainable feedback via a single check ![Merge Protections comment](https://docs.mergify.com/%7BcommentScreen%7D) ## Why Use Merge Protections Instead of Only GitHub Rulesets? | Capability | GitHub Native | Mergify Merge Protections | | ---------- | ------------- | ------------------------- | | Conditional logic (complex AND/OR on PR metadata) | No | Extensive | | Depends-On relationships | No | Yes | | Time / schedule based merge windows | No | Yes | | Repository freeze (manual or scheduled) | No | Yes | | Single composite check gate | Partial | Yes | ## How They Work 1. You enable Merge Protections in the dashboard. 2. A single \`Mergify Merge Protections\` check appears on every PR, or a deployment of the same name if you set \[\`reporting\_method: deployments\`\](/merge-protections/setup#reporting-method-check-runs-vs-deployments). 3. Your protection rules determine whether that check passes. 4. Mergify won't merge a PR until all of its active protection rules succeed, whether the merge comes from the \[merge queue\](/merge-queue), \[Auto-Merge\](/merge-protections/auto-merge), or the \[\`merge\` action\](/workflow/actions/merge). 5. To block merges made outside Mergify too, mark the check as required in \[GitHub Branch Protection or Rulesets\](/merge-protections/setup#make-the-check-required). ## Next Steps The feature is composed of several building blocks documented in dedicated pages: - \[Enabling & Configuration\](/merge-protections/setup) - \[Auto-Merge\](/merge-protections/auto-merge) - \[Built-in Protections\](/merge-protections/builtin) - \[Custom Rules\](/merge-protections/custom-rules) - \[Scheduling Freezes\](/merge-protections/freeze) - \[Examples & Patterns\](/merge-protections/examples) --- # Unknown \--- title: Integrating GitHub with Mergify description: Managing Mergify GitHub installation. --- Mergify is fully integrated with GitHub and many features require Mergify to be installed on your repositories. ## Configuring Enabled Products You enable Mergify products per repository, on the \*\*Repositories\*\* page of the dashboard. Open the organization selector at the top of the sidebar and pick \*\*Configure repositories\*\*; the GitHub tile on the \*\*Integrations\*\* page leads to the same screen. ![The Repositories page, with the Defaults for New Repositories card above the per-repository product grid](https://docs.mergify.com/integrations/%7BgithubIntegScreenshot%7D) The \*\*Defaults for New Repositories\*\* card at the top sets what a repository starts with when it is first connected from GitHub. It leaves your existing repositories untouched, and it only appears if you hold the GitHub organization \`Owner\` role or the \[\*\*Integrations Admin\*\* delegated role\](/security#delegated-roles). To bring in a repository Mergify cannot see yet, use \*\*Add Repository\*\*, which sends you to GitHub to install the Mergify GitHub App on it. :::note Adding a repository requires GitHub admin privileges. ::: Below the card, the table has one row per repository and one column per product: \[Merge Queue\](/merge-queue), \[Merge Protections\](/merge-protections), \[Workflow Automation\](/workflow), and \[CI Insights\](/ci-insights). Check the boxes for the products you want and confirm with \*\*Save Changes\*\*. Nothing is applied until you do. --- # Unknown \--- title: Managing Mergify with Terraform description: How to manage Mergify configuration declaratively with the official Terraform provider. --- The official \[Mergify Terraform provider\]\[registry\] lets you manage your Mergify configuration as code, alongside the rest of your infrastructure. ## Prerequisites 1. The \[Mergify GitHub App\](/integrations/github) is installed on your repositories. 2. A Mergify application key with the \`admin\` scope, or a GitHub personal access token. See \[Authentication\](#authentication) below. ## Installation Declare the provider in your Terraform configuration: \`\`\`hcl terraform { required\_providers { mergify = { source = "Mergifyio/mergify" version = "~> 0.1" } } } provider "mergify" { # Token resolution order: # 1. the \`token\` attribute set here # 2. the MERGIFY\_TOKEN environment variable # 3. the GITHUB\_TOKEN environment variable } \`\`\` Then run: \`\`\`bash terraform init \`\`\` ## Authentication The provider authenticates against the \[Mergify API\](/api) with a bearer token. Both Mergify application keys and GitHub personal access tokens are accepted. An application key must hold the \`admin\` \[scope\](/api/usage#application-key-scopes). A \`ci\` key only reaches the CI-facing endpoints, so the endpoints behind the resources below reject it with \`403\`. That is easy to hit, because \`MERGIFY\_TOKEN\` is also the variable a CI pipeline carries its \`ci\` key in. Tokens are read from, in priority order: 1. The \`token\` attribute on the \`provider\` block. 2. The \`MERGIFY\_TOKEN\` environment variable. 3. The \`GITHUB\_TOKEN\` environment variable. :::caution The \`GITHUB\_TOKEN\` fallback expects a \*\*personal access token\*\* (classic \`ghp\_\*\` or fine-grained \`github\_pat\_\*\`). It is \*\*not\*\* the built-in \`GITHUB\_TOKEN\` secret that GitHub Actions exposes to workflows. That one is a short-lived installation token (\`ghs\_\*\`) which the Mergify API does not accept. In CI, store a PAT or a Mergify application key in a dedicated secret (commonly \`MERGIFY\_TOKEN\`). ::: ## Resources ### \`mergify\_repository\_products\` Manage which Mergify products are enabled on a single GitHub repository. \`\`\`hcl resource "mergify\_repository\_products" "hello\_world" { owner = "octo" repository = "hello-world" products = \["merge\_queue", "merge\_protections", "ci\_insights", "workflow\_automation"\] } \`\`\` The \`products\` attribute is \*\*declarative\*\*: applying the resource sets the exact set of enabled products on the repository, removing any that are not listed. ### \`mergify\_organization\_default\_products\` Manage the default set of Mergify products enabled when a new repository of an organization is discovered by Mergify. \`\`\`hcl resource "mergify\_organization\_default\_products" "defaults" { organization = "octo" products = \["merge\_queue", "merge\_protections"\] } \`\`\` This only affects \*\*new\*\* repositories. Existing ones are managed via \`mergify\_repository\_products\`. \[registry\]: https://registry.terraform.io/providers/Mergifyio/mergify/latest --- # Unknown \--- title: Integrating Jenkins with Mergify description: Run CI Insights via the Mergify Jenkins plugin and Merge Queue Scopes through the Mergify CLI. --- \[Jenkins\](https://www.jenkins.io/) is an open-source automation server. Mergify ships a \[Jenkins plugin\](https://plugins.jenkins.io/mergify/) for CI Insights and supports Merge Queue Scopes through the Mergify CLI. Any Jenkins status check reported to GitHub can also be referenced from your Mergify \[conditions\](/configuration/conditions) via \`check-success\`. ## Prerequisites 1. Jenkins is properly set up and is building your projects. See the \[Jenkins Documentation\](https://www.jenkins.io/doc/) for help with setting up Jenkins. 2. Jenkins is configured to report build statuses to GitHub. This is typically done via plugins such as the \[GitHub plugin\](https://plugins.jenkins.io/github/) or the \[GitHub Branch Source Plugin\](https://plugins.jenkins.io/github-branch-source/). 3. The \[Mergify GitHub App\](/integrations/github) is installed in your repository. ## Mergify features for Jenkins - \*\*\[CI Insights\](/ci-insights/setup/jenkins)\*\*: install the Mergify Jenkins plugin to collect job metrics, detect flaky tests, and get Slack notifications for CI failures. - \*\*\[Merge Queue Scopes\](/merge-queue/scopes)\*\*: run only the jobs affected by a batch when processing the merge queue, \[via the Mergify CLI\](/merge-queue/scopes/others#any-ci-mergify-cli). --- # Unknown \--- title: Integrating Buildkite with Mergify description: Run CI Insights, Job Selection, and Merge Queue Scopes on Buildkite. --- \[Buildkite\](https://buildkite.com/) is a CI/CD tool with pipeline orchestration and self-hosted runners. Mergify has native integrations for Buildkite covering CI Insights, Job Selection, and Merge Queue Scopes. Any Buildkite status check reported to GitHub can also be referenced from your Mergify \[conditions\](/configuration/conditions) via \`check-success\`. ## Prerequisites 1. Buildkite is properly set up and is building your projects. See the \[Buildkite Documentation\](https://buildkite.com/docs/tutorials/getting-started) for help with setting up Buildkite. 2. Buildkite is \[configured to report build statuses to GitHub\](https://buildkite.com/docs/integrations/github#connecting-buildkite-and-github). 3. The \[Mergify GitHub App\](/integrations/github) is installed in your repository. ## Mergify features for Buildkite - \*\*\[CI Insights\](/ci-insights/setup/buildkite)\*\*: collect Buildkite job metrics, detect flaky tests, and get Slack notifications for CI failures. - \*\*\[Job Selection\](#job-selection)\*\*: skip unaffected steps on pull requests to cut CI spend in monorepos. - \*\*\[Merge Queue Scopes\](/merge-queue/scopes)\*\*: run only the jobs affected by a batch when processing the merge queue. Examples for \[Bazel\](/merge-queue/scopes/bazel), \[Nx\](/merge-queue/scopes/nx), and \[Turborepo\](/merge-queue/scopes/turborepo) are available. {/\* Keeps links to the section's former name, Monorepo CI, landing here. \*/} \## Job Selection Job Selection is \[scopes\](/merge-queue/scopes) applied to your pipelines. The same \`scopes\` block that lets the merge queue batch by scope also tells your pipeline which steps have work to do, so a pull request that only touches the frontend does not pay for the API and docs test suites. This section covers step skipping on pull requests. For smarter batching or \[parallel mode\](/merge-queue/queue-modes#parallel-mode) in the merge queue, scopes already do that on their own. See \[Merge Queue Scopes\](/merge-queue/scopes). Running GitHub Actions instead? The \[GitHub Actions integration\](/integrations/gha#job-selection) covers the same ground. Scopes themselves are CI-agnostic, so for any other provider \[let us know\](mailto:support@mergify.com) and see \[other build tools\](/merge-queue/scopes/others). ### Declare your scopes The plugin reads the \`scopes\` block of your \`.mergify.yml\` to know which areas of the repository map to each scope name: \`\`\`yaml scopes: source: files: frontend: include: - apps/web/\*\*/\* api: include: - services/api/\*\*/\* docs: include: - docs/\*\*/\* \`\`\` ### Pipeline outline A Buildkite pipeline driven by scopes has two parts: 1. \*\*Detect scopes\*\* using the \[\`mergifyio/mergify-ci\`\](https://github.com/Mergifyio/mergify-ci-buildkite-plugin) plugin. 2. \*\*Use a dynamic pipeline\*\* to conditionally upload only the steps that match the affected scopes. \`\`\`dot class="queue" title="detect-scopes runs first, and each test step runs only when its scope changed" digraph { PR \[label="Pull request\\nchanges", class="external"\]; Config \[label="Scopes config\\n(.mergify.yml)", class="config"\]; Detect \[label="detect-scopes step\\n(mergify-ci plugin)", class="pending"\]; Frontend \[label="frontend-tests\\n(run)", class="pending"\]; Docs \[label="docs-tests\\n(run)", class="pending"\]; API \[label="api-tests\\n(skipped)", class="muted"\]; PR -> Detect; Config -> Detect; Detect -> Frontend \[label="scope: frontend"\]; Detect -> Docs \[label="scope: docs"\]; Detect -> API \[label="scope: api (false)", class="muted", style=dashed\]; } \`\`\` ### Static pipeline entry point \`\`\`yaml # .buildkite/pipeline.yml steps: - label: ":mag: Detect scopes" key: detect-scopes plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes - label: ":pipeline: Upload conditional steps" depends\_on: detect-scopes command: .buildkite/dynamic-pipeline.sh | buildkite-agent pipeline upload \`\`\` The plugin reads your application key from \`MERGIFY\_TOKEN\` in the agent's environment. It needs the \[\`ci\` scope\](/api/usage#application-key-scopes); an \`admin\` key is rejected. Detection is local, so the meta-data this step writes, and the step skipping below that reads it, work without a token. What a missing token costs is the upload: the plugin logs a warning and sends nothing, so the merge queue never sees the scopes. The test steps the dynamic pipeline emits need the token too, and they can run on different agents from the one that detected the scopes. \### Dynamic pipeline script The script below parses the scope results with \[\`jq\`\](https://jqlang.github.io/jq/), so install it on your Buildkite agents first. \`\`\`bash #!/bin/bash # .buildkite/dynamic-pipeline.sh set -euo pipefail SCOPES=$(buildkite-agent meta-data get "mergify-ci.scopes" --default '{}') echo "steps:" if echo "$SCOPES" | jq -e '.frontend == "true"' > /dev/null 2>&1; then cat <<'YAML' - label: ":react: Frontend tests" command: npm test plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: junit-process report\_path: "junit.xml" YAML fi if echo "$SCOPES" | jq -e '.api == "true"' > /dev/null 2>&1; then cat <<'YAML' - label: ":gear: API tests" command: pytest tests/api/ plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: junit-process report\_path: "reports/\*.xml" YAML fi if echo "$SCOPES" | jq -e '.docs == "true"' > /dev/null 2>&1; then cat <<'YAML' - label: ":books: Docs build" command: make docs YAML fi # Buildkite rejects a pipeline with no steps, so emit a no-op when a pull # request touches nothing in any scope. if \[ "$(echo "$SCOPES" | jq '\[.\[\] | select(. == "true")\] | length')" = "0" \]; then cat <<'YAML' - label: ":fast\_forward: No affected scopes" command: "true" YAML fi \`\`\` Make the script executable: \`\`\`bash chmod +x .buildkite/dynamic-pipeline.sh \`\`\` In this pipeline: - The \`detect-scopes\` step calls the \`mergifyio/mergify-ci\` plugin with the \`scopes\` action, which inspects the pull request diff and stores a JSON map of scopes (\`"true"\` or \`"false"\`) as Buildkite meta-data under the key \`mergify-ci.scopes\`. It also annotates the build with the scopes it found, so they are readable on the build page without opening the step log. - The dynamic pipeline script reads the scopes meta-data and only emits the steps for scopes that are \`"true"\`, so unaffected steps are skipped entirely. - Each test step can optionally use the \`junit-process\` action to upload test results to CI Insights. ### Triggering separate pipelines If your monorepo builds live in separate Buildkite pipelines, use trigger steps instead: \`\`\`bash #!/bin/bash # .buildkite/dynamic-pipeline.sh set -euo pipefail SCOPES=$(buildkite-agent meta-data get "mergify-ci.scopes" --default '{}') echo "steps:" if echo "$SCOPES" | jq -e '.frontend == "true"' > /dev/null 2>&1; then cat <<'YAML' - trigger: "frontend-pipeline" label: ":react: Trigger frontend pipeline" build: branch: "${BUILDKITE\_BRANCH}" commit: "${BUILDKITE\_COMMIT}" YAML fi if echo "$SCOPES" | jq -e '.api == "true"' > /dev/null 2>&1; then cat <<'YAML' - trigger: "api-pipeline" label: ":gear: Trigger API pipeline" build: branch: "${BUILDKITE\_BRANCH}" commit: "${BUILDKITE\_COMMIT}" YAML fi if echo "$SCOPES" | jq -e '.docs == "true"' > /dev/null 2>&1; then cat <<'YAML' - trigger: "docs-pipeline" label: ":books: Trigger docs pipeline" build: branch: "${BUILDKITE\_BRANCH}" commit: "${BUILDKITE\_COMMIT}" YAML fi if \[ "$(echo "$SCOPES" | jq '\[.\[\] | select(. == "true")\] | length')" = "0" \]; then cat <<'YAML' - label: ":fast\_forward: No affected scopes" command: "true" YAML fi \`\`\` Declare a trigger branch for every scope you define. A scope with no matching branch produces a pull request that silently runs no checks at all. --- # Unknown \--- title: Merge Protection Examples & Patterns description: Practical rule recipes for common compliance, quality, and coordination needs. --- Each recipe below is one item of the \`merge\_protections\` list in your configuration file. See \[Custom Rules\](/merge-protections/custom-rules) for the full rule structure. ## Title Quality Gate \`\`\`yaml name: Title Minimum Length if: - base = main success\_conditions: - "#title > 15" \`\`\` ## Require Linked Issue for Features \`\`\`yaml name: Issue Linked if: - label = feature success\_conditions: - "title ~= #\[0-9\]+" \`\`\` ## Disallow WIP in Title \`\`\`yaml name: No WIP Titles if: - title ~= (?i)wip success\_conditions: - label = allow-wip \`\`\` ## Enforce Changelog Entry When Touching Package \`\`\`yaml name: Changelog Update if: - files ~= ^package/ success\_conditions: - files ~= CHANGELOG.md \`\`\` ## Require Security Review for Sensitive Paths \`\`\`yaml name: Sensitive Code Review if: - files ~= "^(secrets/|encryption/|auth/)" success\_conditions: - label = security-reviewed \`\`\` ## Author Blocklist \`\`\`yaml name: Block Temp Bot if: - author = temp-bulk-bot success\_conditions: - label = automation-approved \`\`\` Feel free to combine & adapt. Keep rules minimal and targeted. --- # Unknown \--- title: Writing Custom Merge Protection Rules description: Define fine-grained success conditions evaluated by the Mergify Merge Protections check. --- ## Rule Structure Rules live under the \`merge\_protections\` key in your configuration file. Each rule needs \`name\`, \`if\`, and \`success\_conditions\`; \`description\` is optional: \`\`\`yaml merge\_protections: - name: description: if: # list (YAML array) of conditions activating the rule - success\_conditions: # list of conditions that must all pass for success - \`\`\` Write them by hand, or build them in the \[dashboard\](/merge-protections/setup), which commits the same YAML to your configuration file through a pull request. Evaluation: - If all \`if\` conditions are true, the rule becomes \*\*active\*\*. - If \*\*active\*\*, all \`success\_conditions\` must be true for the rule to \*\*succeed\*\*. - A failing active rule fails the overall \`Mergify Merge Protections\` check. Inactive rules are ignored (not shown as failing). ## Condition Language The same rich expression system used by Workflow Automation applies. See: - \[Conditions Reference\](/configuration/conditions) - \[Data Types\](/configuration/data-types) Common condition patterns: | Goal | Example Condition | | ---- | ----------------- | | Target specific branch | \`base = main\` | | Enforce title prefix | \`title ~= ^feat:\` | | Require label | \`label = security-reviewed\` | | Match file changes | \`files ~= ^src/\` | | Require author team | \`author = @security-team\` | | Require check success | \`check-success = ci/build\` | ## Examples Each example below is one item of the \`merge\_protections\` list. ### Conventional Commits \`\`\`yaml name: Conventional commits if: - base = main success\_conditions: - 'title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?:' \`\`\` ### Require Design Review for UI Changes \`\`\`yaml name: UI Design Review if: - files ~= "^ui/" success\_conditions: - label = design-approved \`\`\` ### Ensure Security Label if touching Auth Code \`\`\`yaml name: Auth Security Review if: - files ~= ^auth/ success\_conditions: - label = security-reviewed \`\`\` ## Tips - Keep rules focused; split unrelated concerns. - Prefer positive success conditions over large negative patterns. - Use naming conventions for clarity (e.g. Prefix groups: \`Title /\`, \`Security /\`). - Periodically prune obsolete rules to reduce evaluation noise. ## Advanced Strategies Combine Merge Protections with \[Workflow Automation\](/workflow/) (e.g., auto-labeling) so that protections depend on labels automatically applied from code context. --- # Unknown \--- title: Built-in Merge Protections description: "Protections available out of the box: Depends-On, Merge-After, Configuration Changed." --- These protections are automatically interpreted, no configuration required. ## Depends-On Block merging until specified pull requests are merged. Declare dependencies in the PR body: \`\`\`text Depends-On: #123 Depends-On: https://github.com/org/repo/pull/123 Depends-On: org/repo#123 \`\`\` ![Using Depends-On in the pull request body on GitHub](https://docs.mergify.com/merge-protections/%7BdependsOnBody%7D) Rules: - All referenced pull requests must be in repositories with Mergify enabled. A reference Mergify cannot resolve (the repository has no Mergify, or the pull request does not exist) fails the protection rather than waiting on it - They must belong to the same repository owner: the user or organization that owns the repository declaring the dependency - A dependency that is still open blocks the protection until that pull request merges. A circular chain (or a pull request that lists itself) never resolves, so every pull request in the loop stays blocked indefinitely, and none of them merge. Use cases: - Feature split across multiple repos - Schema then implementation - Chained refactors ### Seeing dependencies in the merge queue Because a pull request with a \`Depends-On:\` header merges after the ones it depends on, it can sit behind a lower-priority pull request for no visible reason. The \[merge queue\](/merge-queue) shows why: a queued pull request held back by a dependency carries a dependency icon in the list, and its side panel gains a \*\*Depends On\*\* section linking to each queued pull request it waits for. The merge queue status \[API\](/api/usage) reports the same list as \`depends\_on\_pull\_requests\`. The queue shows this only for the pull requests ahead of it in a \[stack\](/merge-queue/stacks) in the same repository, and only while they are still queued: one that has merged or been \[dequeued\](/merge-queue/lifecycle#removing-a-pull-request-from-the-merge-queue) leaves the list. Any other dependency still blocks the merge without appearing there, whether it points at a pull request in another repository or at one in the same repository that is not part of the same stack. ## Merge-After Delay merging until a future time using a header in the PR description: \`\`\`text Merge-After: 2025-09-01T09:00:00Z \`\`\` Supports the standard \[timestamp format\](/configuration/data-types#timestamp). Useful for coordinated releases or off-peak deploy windows. ![Using Merge-After in the pull request body on GitHub](https://docs.mergify.com/merge-protections/%7BmergeAfterBody%7D) A value Mergify cannot read as a timestamp blocks the pull request indefinitely rather than failing the protection outright. The check reports \`Merge-After date is invalid\` alongside the value it read; fix the header in the pull request body to unblock it. ## Configuration Changed When a pull request targeting your default branch modifies your \[Mergify configuration file\](/configuration/file-format), Mergify validates the new configuration and reports the result as a \`Configuration changed\` check. This protection requires that check to succeed, so a pull request whose configuration Mergify cannot validate does not merge. A pull request that leaves the configuration file alone is not affected. A pull request that deletes the configuration file rather than editing it never gets a \`Configuration changed\` check. It reports under \`Configuration has been deleted\` instead, which Mergify posts as a success, and that check satisfies this protection too. Removing the configuration is an accepted outcome, not a failure. --- # Unknown \--- title: Auto-Merge description: Automatically merge or queue pull requests when all merge protection conditions pass. --- Mergify can act on a pull request as soon as all applicable \[merge protection\](/merge-protections/custom-rules) \`success\_conditions\` are satisfied. The exact action (merge directly or add to the \[merge queue\](/merge-queue)) depends on whether the merge queue is enabled for the repository. Auto-merge is configured with the \`auto\_merge\_conditions\` field under \`merge\_protections\_settings\`. It accepts \`true\` for unconditional auto-merge, or a list of conditions to restrict the audience. ## Configuration ### Unconditional auto-merge Set \`auto\_merge\_conditions: true\` to auto-merge every pull request that satisfies the merge protections: \`\`\`yaml merge\_protections\_settings: auto\_merge\_conditions: true merge\_protections: - name: require-review-and-ci if: - base = main success\_conditions: - "#approved-reviews-by >= 1" - check-success = ci \`\`\` Any pull request targeting \`main\` with at least one approved review and a passing \`ci\` check is automatically merged (or queued if the merge queue is enabled). ### Conditional auto-merge Pass a list of conditions to restrict auto-merge to pull requests that match. Only matching pull requests are auto-merged. Other pull requests still need to be merged manually or queued via the \[\`@mergifyio queue\` command\](/commands/queue). \`\`\`yaml merge\_protections\_settings: auto\_merge\_conditions: - author = dependabot\[bot\] \`\`\` The list accepts the same condition syntax as \`success\_conditions\`, including nested \`and\`, \`or\`, and \`not\` operators. ### Behavior matrix | \`auto\_merge\_conditions\` | Merge queue enabled? | Behavior | |---|---|---| | \`true\` | Yes | Every PR is auto-queued. The merge queue then handles routing and merging | | \`true\` | No | PR is auto-merged once the merge protections pass | | List of conditions | Yes | PR is auto-queued when conditions match. The merge queue then handles routing and merging | | List of conditions | No | PR is auto-merged once both the conditions and the merge protections pass | | omitted | — | No automatic action. Merge manually or use the \[\`@mergifyio queue\` command\](/commands/queue) | ### Accepted and rejected values \`auto\_merge\_conditions\` accepts: - \`true\`: unconditional auto-merge. - A list of conditions: conditional auto-merge. The schema rejects \`false\` and any mapping, empty (\`{}\`) or not. An explicit \`null\` is accepted and means the same as omitting the field: auto-merge stays off. ## Examples ### Bot-only auto-merge Auto-merge dependency updates from Dependabot, leaving every other pull request to be merged manually: \`\`\`yaml merge\_protections\_settings: auto\_merge\_conditions: - author = dependabot\[bot\] \`\`\` ### Label-gated auto-merge Auto-merge any pull request that carries the \`ready-to-merge\` label: \`\`\`yaml merge\_protections\_settings: auto\_merge\_conditions: - label = ready-to-merge \`\`\` ## Migrating from \`autoqueue\` \`queue\_rules\[\].autoqueue\` is deprecated. The replacement is \`auto\_merge\_conditions\` in \`merge\_protections\_settings\`. Mergify opens an automatic migration pull request that rewrites the configuration. The translation depends on the shape of the original configuration: - \*\*All queues had \`autoqueue: true\`\*\*: the migration produces \`auto\_merge\_conditions: true\`. Each queue's existing \`queue\_conditions\` still gate routing, so they don't need to be duplicated. - \*\*One autoqueued queue alongside manual queues\*\*: the migration inlines that queue's \`queue\_conditions\` into \`auto\_merge\_conditions\`. - \*\*Multiple autoqueued queues alongside manual queues\*\*: the migration produces an \`or\` over each autoqueued queue's conditions. - \*\*Autoqueued queue with empty \`queue\_conditions\`\*\*: collapses to \`auto\_merge\_conditions: true\`, since an empty list matches every pull request. When a configuration mixes autoqueued and manual queues, the migration pull request includes a YAML comment listing the queues that remain manual-only. Those queues stay reachable via the \[\`@mergifyio queue\` command\](/commands/queue). Apply the migration in one step: a configuration that sets \`auto\_merge\_conditions\` while a queue rule still has \`autoqueue\` is rejected. ### Example Before: \`\`\`yaml queue\_rules: - name: dependencies autoqueue: true queue\_conditions: - author = dependabot\[bot\] merge\_conditions: - check-success = ci - name: default queue\_conditions: - check-success = ci \`\`\` After: \`\`\`yaml queue\_rules: - name: dependencies queue\_conditions: - author = dependabot\[bot\] merge\_conditions: - check-success = ci - name: default queue\_conditions: - check-success = ci merge\_protections\_settings: auto\_merge\_conditions: - author = dependabot\[bot\] \`\`\` ## Constraints Merge Protections must be enabled on the repository for \`auto\_merge\_conditions\` to take effect, with or without the merge queue. See \[Enabling & Configuring Merge Protections\](/merge-protections/setup). \`auto\_merge\_conditions\` and \`queue\_rules\[\].autoqueue\` cannot be used together. A configuration that sets both is rejected, so remove \`autoqueue\` from your queue rules in the same change. Without the merge queue, \`auto\_merge\_conditions\` only takes effect when at least one \[merge protection rule\](/merge-protections/custom-rules) applies to the pull request: with no rule whose \`if\` conditions match, there are no \`success\_conditions\` to evaluate and nothing is merged. With the merge queue enabled, a matching pull request is queued whether or not merge protection rules exist, and the queue's own conditions gate the merge. --- # Unknown \--- title: Enabling & Configuring Merge Protections description: How to enable Merge Protections, pick a reporting method, and decide whether the check needs to be required in GitHub. --- ## Enable in the Dashboard 1. Go to the \[Mergify dashboard\](https://dashboard.mergify.com) 2. Click the \`Merge Protections\` section 3. Select your repository 4. Activate the product, then create rules under \`Rules\` ![Merge Protections rules for a repository](https://docs.mergify.com/merge-protections/%7BmainScreen%7D) The rules themselves live in your repository's \[configuration file\](/configuration/file-format), under the \`merge\_protections\` key. The dashboard's rule builder is an editor for that file: it opens a pull request adding your rules to it. You can write them by hand instead. See \[Custom Rules\](/merge-protections/custom-rules) for the rule structure. ## Reporting Method: check-runs vs deployments You can configure how Merge Protections report their status to GitHub using the \`reporting\_method\` option in your configuration. This controls whether the protection status appears as a GitHub Check Run or as a Deployment. - \`check-runs\` (default): Reports the protection status as a standard GitHub check on the pull request. This is the most common and compatible method. ![GitHub required checks](https://docs.mergify.com/merge-protections/%7BrequiredChecksScreen%7D) - \`deployments\`: Reports the protection status as a GitHub Deployment. This can be useful if your workflow or compliance requirements rely on deployment status. ![Merge Protections deploy success](https://docs.mergify.com/merge-protections/%7BdeployScreenshot%7D) Example configuration: \`\`\`yaml merge\_protections\_settings: reporting\_method: check-runs # or deployments # Post a comment with details about required rules post\_comment: true # Automatically merge or queue PRs when all protections pass auto\_merge\_conditions: true \`\`\` Choose the method that best fits your integration and compliance needs. ### Auto-Merge The \`auto\_merge\_conditions\` option automatically merges or queues pull requests when all merge protection \`success\_conditions\` pass. It accepts \`true\` for unconditional auto-merge or a list of conditions to restrict the audience. Auto-merge is disabled when the field is omitted. See \[Auto-Merge\](/merge-protections/auto-merge) for the full behavior reference and configuration examples. ## Make the Check Required Enabling inserts a check named \`Mergify Merge Protections\` on each pull request, or a deployment of the same name if you set \`reporting\_method: deployments\`. Mergify enforces your protections on every merge it performs itself, whether it comes from the \[merge queue\](/merge-queue), \[Auto-Merge\](/merge-protections/auto-merge), or the \[\`merge\` action\](/workflow/actions/merge): it won't merge a pull request until all of its active merge protections succeed. You don't have to require the check in GitHub for that to happen. Requiring it in GitHub is what blocks a merge that doesn't go through Mergify: someone clicking GitHub's merge button, or another tool calling GitHub's merge API. Unless every merge on the repository goes through Mergify, mark the result as required, as a check or as a deployment depending on your reporting method: - GitHub Branch Protection: Settings → Branches → Add/Edit rule → Require status checks / deployment to succeed → select \`Mergify Merge Protections\` - GitHub Rulesets: Settings → Rules → Select ruleset → Add required status check / deployment to succeed → \`Mergify Merge Protections\` ![GitHub Branch Protection](https://docs.mergify.com/merge-protections/%7BbpScreen%7D) When an active protection fails, the check explains why in its output, and in a summary comment unless you set \`post\_comment: false\`. ## Updating Rules - Safe to edit live; re-evaluations happen automatically. - Renaming a rule only changes display text; logic is defined by the condition blocks. - Remove obsolete rules to keep explanations short. --- # Unknown \--- title: Scheduling Freezes description: Temporarily block merging during maintenance, release, or blackout windows. --- A freeze holds back the pull requests it matches until the freeze ends. You schedule one ahead of a window where nothing should land, or start one on the spot, from the dashboard or the CLI. ## When to Use a Freeze Use freezes to coordinate: - Critical release stabilization - High-traffic events where deploy risk must be minimized - End-of-quarter / audit windows - Incident response (manual immediate freeze) ## What a Freeze Blocks Without the \[merge queue\](/merge-queue), an active freeze leaves the \`Mergify Merge Protections\` check pending on every matching pull request, and its summary names the freeze holding it back: waiting for that freeze to end, or, when the freeze has no end date, waiting for someone to remove it. Pull requests matching the freeze's exclude conditions are left alone (see \[Allowing Exceptions\](#allowing-exceptions) below), as are pull requests that cannot be merged anyway: drafts, closed ones, and conflicting ones. When the merge queue is enabled, the freeze is reported in that check but is not what decides its conclusion. The queue holds the merge back until the freeze ends. :::caution Mergify evaluates the freeze, but only GitHub can stop a merge made outside Mergify. Unless your branch requires \`Mergify Merge Protections\` to succeed (as a check, or as a deployment if you set \`reporting\_method: deployments\`), someone can still merge a pull request straight from the GitHub UI while the freeze is active. See \[Make the Check Required\](/merge-protections/setup#make-the-check-required) to close that gap. ::: ## Creating a Scheduled Freeze ![Scheduled Freezes](https://docs.mergify.com/merge-protections/%7BscheduleFreezeScreen%7D) In the dashboard under \`Merge Protections\` → \`Scheduled Freezes\`: 1. Click \`Schedule a Freeze\` 2. Fill in the reason at the top of the editor. It is required, and it names the freeze wherever Mergify reports it 3. Under \`Schedule\`, set \`Starts\` and \`Ends\`, and the \`Timezone\` they are read in. Leave \`Ends\` empty for a freeze that lasts until you remove it 4. Under \`Scope\`, add the \[conditions\](/configuration/conditions) a pull request must match to be blocked. Leave it empty to freeze every pull request on the repository 5. Under \`Exceptions\`, add the conditions that let a pull request through the freeze, so specific pull requests (like hotfixes) can still merge while everything else is blocked 6. Click \`Save Freeze\`; the freeze appears in the list under \`Upcoming\` until it starts ![New Scheduled Freeze](https://docs.mergify.com/merge-protections/%7BnewScheduleFreezeScreen%7D) ## Manual Instant Freeze Use the \`Freeze Now\` action for immediate blocking. It opens the same editor without a start date: pull requests matching \`Scope\` are blocked the moment you save. Set an end date and the freeze lifts itself, or leave it empty and remove the freeze when you are done. ## Recurring Merge Windows A freeze covers a single window: it has one start and one end, and nothing repeats it. To block merges on a recurring basis, such as outside working hours or every weekend, write a \[merge protection rule\](/merge-protections/custom-rules) with a \`schedule\` condition instead: \`\`\`yaml merge\_protections: - name: Merge during working hours description: Only merge between 9am and 5pm, Monday to Friday if: - base = main success\_conditions: - schedule = Mon-Fri 09:00-17:00\[America/Chicago\] \`\`\` Outside the window the rule is pending, so the \`Mergify Merge Protections\` check holds the pull request back the same way an active freeze does; the rule passes again once the window reopens. See \[schedule\](/configuration/data-types#schedule) for the accepted formats. ## Allowing Exceptions To let specific pull requests through a freeze, use exclude conditions. They are combined with a logical AND: a pull request escapes the freeze only when it matches all of them. Exclude conditions \`label=hotfix\` and \`label=urgent\` let through pull requests carrying both labels, not those carrying only one. Set exclude conditions when you create or edit a freeze, in the dashboard's \`Exceptions\` section or from the CLI with the \`-e\` flag (see \[Creating a Freeze\](#creating-a-freeze) below). For example, exclude pull requests labeled \`hotfix\` so urgent fixes can still merge during the freeze. ## Managing Freezes with the CLI You can also manage freezes from the command line with the Mergify CLI. The examples below cover the common workflows; the \[\`freeze\` CLI reference\](/cli/freeze) lists every command, flag, and option. ### Listing Freezes List all scheduled freezes for a repository: \`\`\`bash mergify freeze list \`\`\` Use \`--json\` to get machine-readable output: \`\`\`bash mergify freeze list --json \`\`\` ### Creating a Freeze Create a time-bounded freeze: \`\`\`bash mergify freeze create \\ --reason "Release stabilization" \\ --timezone UTC \\ --start 2024-01-15T18:00:00 \\ --end 2024-01-15T22:00:00 \`\`\` Create an emergency freeze with no end time: \`\`\`bash mergify freeze create \\ --reason "Incident response" \\ --timezone UTC \`\`\` You can restrict which pull requests are affected with matching conditions (\`-c\`) and let specific ones through with exclude conditions (\`-e\`): \`\`\`bash mergify freeze create \\ --reason "Freeze main branch" \\ --timezone UTC \\ -c "base=main" \\ -e "label=hotfix" \`\`\` Here the freeze applies to pull requests targeting \`main\`, except those labeled \`hotfix\`, which can still merge. ### Updating a Freeze Modify an existing freeze by its ID: \`\`\`bash mergify freeze update \\ --end 2024-01-16T06:00:00 \`\`\` ### Deleting a Freeze Remove a freeze by its ID: \`\`\`bash mergify freeze delete \`\`\` :::note If the freeze is currently active, you must provide a reason: \`\`\`bash mergify freeze delete \--reason "Incident resolved" \`\`\` ::: --- # Unknown \--- title: Direct Merge description: Merge a queued pull request immediately, with no queue CI run, when the base branch has not moved in any way that can affect it. --- A merge queue exists to test a pull request against the state its base branch will actually have at merge time. When that state has not meaningfully changed for this particular pull request, testing it again proves nothing: the green CI already on the pull request covers the merge. \*\*Direct Merge\*\* is the optimization that recognizes those cases. When a pull request reaches the front of its lane on its own, Mergify asks what the base branch has done underneath it since that pull request was last updated. Two answers let it merge straight away, with no batch pull request and no merge queue CI run: - \*\*Already up to date.\*\* The pull request already contains the tip of the base branch, so the code that would land is the code its own CI already ran on. - \*\*Behind only in other scopes.\*\* The pull request is behind, but only by merges the queue landed in \[scopes\](/merge-queue/scopes) it does not touch. Neither needs to be turned on. The first case applies to every repository, with or without scopes, in all three \[queue modes\](/merge-queue/queue-modes). The second needs scopes, and any repository using them gets it on the pull requests that qualify. Here is the whole decision. PR #42 touches the \`frontend\` scope; while it waited, the queue landed two merges that touched \`api\` and \`docs\`. Nothing PR #42 depends on has changed, so its own green CI still describes the merge and the queue skips straight to merging it. Had the queue landed nothing at all in the meantime, the first question alone would have been enough. \`\`\`dot class="flow" title="Direct merge — what the queue checks before skipping CI" digraph { splines=polyline; // The decision path is declared first so it takes the left of the drawing, // and the "no" branches fall straight down it. What merged meanwhile sits // to the right and feeds the second question from the side, so nothing // crosses. PR \[label="PR #42, first in its lane\\nscope: frontend, CI already green", class="queued"\]; Q1 \[label="Behind the\\nbase branch?", shape=diamond, margin="0.14,0.06", class="pending"\]; Q2 \[label="Any scope\\nin common?", shape=diamond, margin="0.14,0.06", class="pending"\]; DIRECT \[label="Direct merge\\nno batch pull request, no queue CI", class="merged"\]; QUEUE \[label="Batch pull request\\nfull queue CI run", class="muted"\]; subgraph cluster\_base { class="batch"; label="Merged while #42 waited"; // Wide enough for the label above: a cluster is sized to its content, // and the label is painted wider than Graphviz measured it. M1 \[label="queue merge\\nscope: api", width=2.5, class="muted"\]; M2 \[label="queue merge\\nscope: docs", width=2.5, class="muted"\]; M1 -> M2; } DELTA \[label="Base delta scopes\\napi, docs", shape=oval, class="config"\]; PR -> Q1; Q1 -> DIRECT \[label=" no", class="merged"\]; Q1 -> Q2 \[label=" yes"\]; M2 -> DELTA; DELTA -> Q2; Q2 -> DIRECT \[label=" no", class="merged"\]; Q2 -> QUEUE \[label=" yes"\]; // Direct merge on the left, under the "no" branches; the batch on the right. { rank=same; DIRECT -> QUEUE \[style=invis\]; } } \`\`\` ## Why this is safe ### The already-up-to-date case There is nothing to prove. The tip of the base branch is already an ancestor of the pull request's head, so merging changes what the base branch points at without changing what it contains: the code that lands is the code the pull request's own CI ran on. A batch pull request would test the same change against the same base a second time. ### The scope case Two pull requests only need to be tested together when they can affect each other. Scopes are the declaration of what a pull request can affect, so two pull requests with disjoint scopes cannot interact by construction. A frontend change does not become wrong because a database migration landed while it was queued. Direct Merge applies that reasoning to a single pull request and the base branch beneath it: 1. Read the current tip of the base branch. 2. Walk back through the merges the merge queue itself recorded, until reaching a commit the pull request already contains. 3. Union the scopes of every merge in between. 4. If that union does not intersect the pull request's own scopes, merge it as is. The walk only trusts merges the merge queue performed and recorded. It stops, and Direct Merge declines, as soon as it cannot attribute a missing base commit to one of those recorded merges, whether that is an external merge, a direct push to the base branch, or any commit it has no record of. ## When it applies Direct Merge is deliberately conservative. Whenever it cannot prove the base changes are unrelated, it declines rather than guesses, and the pull request takes the normal queue path, with a batch pull request and a full CI run. ### In both cases - \*\*The pull request is alone at the front of its lane.\*\* Nothing the queue has yet to merge sits between it and the base branch. - \*\*The queue tests in a batch pull request.\*\* A queue running \[in-place checks\](/merge-queue/batches#in-place-checks-no-batch-prs) tests the pull request on its own branch instead, so there is no batch pull request for Direct Merge to skip. - \*\*The queue does not use \[two-step CI\](/merge-queue/two-step).\*\* Two-step CI defers the heavy suite to the queue on purpose, so the pull request's own CI is not the full signal. - \*\*The merge method is not \[\`merge-batch\`\](/merge-queue/merge-strategies#merge-batch).\*\* It merges the batch pull request itself, so there has to be one. ### Only for the already-up-to-date case Nothing more. This case needs no scopes and no scope configuration. It is also the one place a \[\`fast-forward\`\](/merge-queue/merge-strategies#fast-forward) queue qualifies: fast-forward moves the base branch onto the pull request's head, and that requires the head to contain the base tip already, which is exactly the situation here. Fast-forward is not supported in the parallel or isolated \[queue modes\](/merge-queue/queue-modes) for reasons of its own, so this only ever arises in a serial queue. ### Only for the scope case - \*\*The pull request has scopes.\*\* Without them it lands in the catch-all lane, where Mergify treats it as able to affect anything. - \*\*It is not a barrier.\*\* A pull request marked \[\`all\_scopes\`\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope) declares that it impacts every scope, including ones not yet defined. - \*\*The base delta is fully recorded.\*\* Every commit it is missing must come from a merge the queue recorded, so that the scopes of those commits are known. - \*\*The merge method is not \[\`fast-forward\`\](/merge-queue/merge-strategies#fast-forward).\*\* A pull request that is behind cannot be fast-forward-merged, because moving the base branch onto its head would drop the commits that head does not contain. Rebasing it first is what the normal queue path does. ## What it changes for you The two cases pay off in different repositories. A pull request that is \*\*already up to date\*\* merges the moment it reaches the front, in any repository. That is the everyday case on a queue that is not permanently busy, and on any pull request rebased or updated shortly before it was queued: nothing landed underneath it, so there is nothing new to test. The \*\*scope\*\* case scales with your monorepo. The larger and more independent its areas are, the more often a busy queue turns out to have landed nothing relevant. A pull request that would have waited for a full validation cycle merges in seconds, and the CI run it would have consumed is never scheduled. Either way it compounds with the rest of the queue rather than replacing it: - \[Parallel mode\](/merge-queue/queue-modes#parallel-mode) already stops unrelated pull requests from queueing behind each other. Direct Merge removes the remaining CI run for the ones that turn out to need no validation at all. - \[Batches\](/merge-queue/batches) still handle the pull requests that do share scopes, with bisection when one of them fails. :::note Direct Merge only ever skips the \*queue's\* CI run. The queue rules still apply in full: a pull request that does not satisfy them is not merged, directly or otherwise. ::: ## Getting the most out of it The already-up-to-date case asks nothing of you. The scope case pays off in proportion to how well your scopes describe your repository, so the work that improves it is the work that makes scopes accurate: - \*\*Derive scopes from your build system\*\* where you can. A build graph knows exactly what a change affects, so the scope sets come out both correct and narrow. See \[Bazel\](/merge-queue/scopes/bazel), \[Nx\](/merge-queue/scopes/nx), \[Turborepo\](/merge-queue/scopes/turborepo), \[Pants\](/merge-queue/scopes/pants) and \[other build tools\](/merge-queue/scopes/others). - \*\*Keep scopes narrow.\*\* A single \`backend\` scope covering half the repository intersects almost everything. Splitting it into the services it really contains makes far more pull requests provably independent. - \*\*Use barriers sparingly.\*\* \`scopes.barrier\_files\` is the right tool for a toolchain bump, but every barrier is a pull request that can never be direct-merged in the scope case, and it blocks the ones queued around it too. --- # Unknown \--- title: Merge Queue description: Ship faster with zero broken builds. Parallel testing, smart batching, and CI cost optimization. hubAccent: true --- Stop wasting engineering time on merge conflicts and broken main branches. Mergify's merge queue tests every PR against the latest code before merging, while parallel execution and smart batching keep your team shipping fast. Get Started → New to merge queues? Learn the fundamentals, failure scenarios, and best practices. \## Glossary Vocabulary used across these pages: | Term | Meaning | |------|---------| | \*\*Queue\*\* | The ordered line of pull requests waiting to merge. | | \*\*Scopes\*\* | Which parts of the codebase a PR touches; used to batch PRs in monorepos or check them in parallel. | | \*\*Batches\*\* | Queued PRs tested together in one CI run to reduce total CI cost and time. | | \*\*Two-step CI\*\* | Run fast tests on every PR, and run expensive tests only before merge. | | \*\*Parallel checks\*\* | Run CI speculatively on multiple queued PRs at once, instead of one at a time. | ## Do You Need a Merge Queue? If any of these sound familiar, a merge queue can help: | Symptom | What's Happening | How Mergify Helps | |---------|------------------|-------------------| | PRs pass CI but break main | PRs tested against stale base | Tests every PR against latest main | | Developers wait hours to merge | Serial merge bottleneck | Parallel speculative testing | | CI bill keeps climbing | Full test suite on every PR | Batching + two-step CI | | Monorepo PRs block each other | Unrelated changes queued together | Scoped queues for independent paths | | Hotfixes stuck behind features | No priority mechanism | Priority rules for urgent PRs | ## Which Problem Are You Solving? Jump straight to the feature that matches your pain point: | Problem | Feature | |---------|---------| | PRs waiting too long in queue | \[Parallel checks\](/merge-queue/performance#parallel-checks) | | CI cost getting out of hand | \[Batches\](/merge-queue/batches) or \[Two-step CI\](/merge-queue/two-step) | | Paying for CI runs the queue did not need | \[Direct Merge\](/merge-queue/direct-merge) | | Hotfixes blocked behind feature PRs | \[Priority rules\](/merge-queue/priority) | | Monorepo with independent packages | \[Scopes\](/merge-queue/scopes) and \[Monorepo guide\](/merge-queue/monorepo) | | Want to auto-queue approved PRs | \[Auto-Merge\](/merge-protections/auto-merge) and \[Queue rules\](/merge-queue/rules) | | Landing stacked PRs in order | \[Stacked PRs\](/merge-queue/stacks) | ## What Mergify Solves ### Broken Main Branch PRs that pass CI individually can break main when merged together. Mergify updates each PR against the latest main and re-runs CI before merging, catching conflicts before they hit production. \*\*→ \[How the queue works\](/merge-queue/lifecycle)\*\* ### Slow Merge Throughput Serial testing creates bottlenecks. Mergify tests multiple PRs in parallel using speculative execution, so your queue moves as fast as your CI allows. \*\*→ \[Parallel checks\](/merge-queue/performance#parallel-checks) | \[Queue modes\](/merge-queue/queue-modes)\*\* ### Spiraling CI Costs Running full test suites on every PR is expensive. Mergify batches PRs together into single CI runs and supports two-step CI to run heavy tests only at merge time. \*\*→ \[Batches\](/merge-queue/batches) | \[Two-step CI\](/merge-queue/two-step)\*\* ### Monorepo Complexity Unrelated changes shouldn't block each other. Mergify uses scopes to identify which services a PR affects and only batches compatible changes together. \*\*→ \[Scopes\](/merge-queue/scopes) | \[Monorepo guide\](/merge-queue/monorepo)\*\* ## Key Features | Feature | What It Does | Impact | |---------|--------------|--------| | \[Queue modes\](/merge-queue/queue-modes) | Serial, parallel, or isolated scheduling | Match speed to PR independence | | \[Parallel checks\](/merge-queue/performance) | Test multiple PRs simultaneously | 3-5x faster merge throughput | | \[Batches\](/merge-queue/batches) | Combine PRs into single CI runs | 50-80% fewer CI runs | | \[Two-step CI\](/merge-queue/two-step) | Run heavy tests only at merge time | Cut CI costs on draft/WIP PRs | | \[Direct Merge\](/merge-queue/direct-merge) | Skip the queue CI run when nothing relevant moved | No CI run at all | | \[Priority\](/merge-queue/priority) | Let urgent PRs jump the queue | Ship hotfixes in minutes | | \[Scopes\](/merge-queue/scopes) | Separate queues for monorepo paths | No cross-service blocking | | \[Pause\](/merge-queue/pause) | Suspend merging during incidents | Instant incident response | | \[Stacked PRs\](/merge-queue/stacks) | Queue a whole stack from one comment | Stacks land bottom-up automatically | ## Mergify vs GitHub Native Merge Queue | Capability | GitHub Native | Mergify | |------------|---------------|---------| | Parallel speculative checks | Up to 100 | Up to 128 | | Batch multiple PRs | | Configurable size + CI optimization | | Priority rules | | Label or rule-based | | Monorepo scopes | | Path-based queues + Bazel/Nx integration | | Two-step CI | | Draft CI + merge CI | | Pause/freeze queue | | Dashboard, CLI, or API | | Cross-repo queues | | Coordinate dependent repos | | Queue analytics | | Wait times, throughput, failures | ## Learn More Track queue performance, monitor throughput metrics, and measure CI cost savings. Configure queue rules, set up CI integration, and tune parallel check settings. Understand PR lifecycle, queue behavior, and how to use priority labels. \## Quick Reference \*\*Setup & Configuration\*\* \[Setup guide\](/merge-queue/setup) · \[Queue rules\](/merge-queue/rules) · \[Merge strategies\](/merge-queue/merge-strategies) · \[Freeze conditions\](/merge-protections/freeze) \*\*Performance & Optimization\*\* \[Performance tuning\](/merge-queue/performance) · \[Direct Merge\](/merge-queue/direct-merge) · \[Monitoring\](/merge-queue/monitoring) · \[Deployment strategies\](/merge-queue/deploy) \*\*Advanced Features\*\* \[Monorepo guide\](/merge-queue/monorepo) · \[Dependent PRs\](/merge-protections/builtin) \*\*Operations\*\* \[Pause queue\](/merge-queue/pause) · \[PR commands\](/commands) --- # Unknown \--- title: Pausing the Merge Queue description: Understand the pause feature and how to use it during CI incidents. --- Pausing Mergify's Merge Queue suspends its automation, typically during a CI incident. This page explains what pausing does, its impacts, and when to use it. ## What Does Pausing Do? When you pause the merge queue: 1. \*\*Suspended\*\*: The merge queue will be suspended. 2. \*\*Addition to the Queue Continues\*\*: Even with a paused merge queue, new pull requests can still join the queue. This ensures pull requests remain organized and ready for when operations resume. 3. \*\*Stops Scheduling and Actions\*\*: After pausing the merge queue, Mergify will not schedule new checks or merge pull requests. Pull requests can enter the queue but won't be acted upon. 4. \*\*Cancel Running Checks\*\*: When you pause the queue, Mergify attempts to cancel any running checks for pull requests that are in the queue and will wait for the queue to be resumed. :::note This cancellation does not apply to checks that are running in place (i.e., checks that run directly on the pull request rather than on a temporary merge commit). Those running checks are not cancelable: if they fail while the queue is paused, the associated pull request will be removed from the merge queue as the queue conditions will not match anymore. ::: ## How to Pause the Merge Queue ### From the Dashboard Navigate to your \[Mergify dashboard\](https://dashboard.mergify.com). There you'll find an option to pause the merge queue. Clicking on this will suspend the queue. ![Pause button is in the top right corner in Mergify's dashboard](https://docs.mergify.com/merge-queue/%7BscreenshotButtonPause%7D) ### Using the CLI Pause the queue from the terminal with a reason (required): \`\`\`bash mergify queue pause --reason "deploying hotfix" \`\`\` Resume when ready: \`\`\`bash mergify queue unpause \`\`\` See the \[\`queue\` CLI reference\](/cli/queue) for all pause options and the rest of the queue commands. ### Using the API You can also pause the merge queue programmatically: the \[merge queue API\](/api/merge-queue) exposes pausing as a \`PUT\` and lifting it as a \`DELETE\` on the same endpoint. See \[API usage\](/api/usage) for authentication. ## Typical Use Cases ### CI Incidents During a major incident with the CI system, if checks are likely to fail and eject pull requests from the queue, pause the merge queue until the incident is resolved. ### Non-CI Incidents If an incident is unrelated to the CI, like a production issue, but you wish to halt merging while allowing checks to run, then the \[scheduled freeze feature\](/merge-protections/freeze) is a more suitable choice. ## Benefits of Using the Pause Feature 1. \*\*Maintain Queue Integrity\*\*: During CI failures or other disruptions, pausing ensures pull requests stay in the queue, preserving their order. 2. \*\*Flexibility\*\*: It provides an immediate response tool during unexpected complications, giving you control over the merge process. 3. \*\*Reduce Noise\*\*: Constantly failing checks during a CI incident can create unnecessary notifications. Pausing the queue mitigates this. --- # Unknown \--- title: GitHub Rulesets Compatibility description: How Mergify interacts with GitHub branch protections and rulesets, including known incompatibilities and how to resolve them. --- Mergify automatically detects \[GitHub branch protections\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) and \[rulesets\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets) configured on your repository and injects the supported ones as conditions. This page explains how that injection works, which ruleset rule types are supported, which ones are incompatible with the merge queue, and how to resolve conflicts. ## Recommended Ruleset Setup A ruleset shaped like this works with the merge queue without further tuning. The rest of this page explains what each point protects you from. 1. \*\*Add Mergify to the bypass list with the \`exempt\` bypass mode\*\*, on every ruleset that applies to a branch you queue. See \[Bypass Actors\](#bypass-actors) for what the other two modes leave blocked. 2. \*\*Keep rulesets off the queue branches\*\* (\`mergify/merge-queue/\*\` unless you set \[\`queue\_branch\_prefix\`\](/configuration/file-format/#queue-rules)), or bypass them as above. See \[Required Signatures and Branch Deletion\](#required-signatures-and-branch-deletion), \[Branch Name Pattern\](#branch-name-pattern), and the \[compatibility table\](#ruleset-rule-compatibility) for \`creation\` and \`update\`. 3. \*\*Require at least one approving review, if you require reviews at all.\*\* At an approval count of \`0\`, Mergify has to rebuild the review gate itself, with gaps. See \[Review Requirements\](#review-requirements). 4. \*\*Leave \*Require branches to be up to date before merging\* off\*\*, unless you use \[in-place checks\](/merge-queue/batches#in-place-checks-no-batch-prs) or the \[\`fast-forward\` merge method\](/merge-queue/merge-strategies#fast-forward). See \[Require Branches to Be Up to Date\](#require-branches-to-be-up-to-date). 5. \*\*Leave GitHub's native \`merge\_queue\` rule off\*\* on the branches you queue with Mergify. See \[GitHub Native Merge Queue Rule\](#github-native-merge-queue-rule). 6. \*\*Keep review requirements off the head branches you queue\*\* if you use in-place checks. See \[In-Place Checks and Review Requirements\](#in-place-checks-and-review-requirements). 7. \*\*Re-express anything Mergify does not handle as a rule it does handle\*\*, usually a CI check behind a \`required\_status\_checks\` rule. See \[Ignored Rule Types\](#ignored-rule-types). ## How Condition Injection Works When Mergify processes a pull request, it reads the branch protection and ruleset rules that apply to the target branch and converts them into \[merge conditions\](/configuration/conditions). For example, if you require at least one approved review, Mergify injects the condition \`#approved-reviews-by >= 1\`. This injection happens automatically for both the \[\`merge\`\](/workflow/actions/merge) action and the merge queue. For the merge queue, you can control how injection behaves using the setting below. ### Controlling Injection You can control merge queue injection with the \[\`branch\_protection\_injection\_mode\`\](/configuration/file-format/#queue-rules) option on your queue rules: - \*\*\`queue\`\*\* (default) -- rules are injected as required conditions for both queuing and merging pull requests. - \*\*\`merge\`\*\* -- rules are injected as merge conditions, checked after the queue has tested the pull request. See \[Injection Mode \`merge\` and Required Status Checks\](#injection-mode-merge-and-required-status-checks) for when this mode conflicts with a ruleset. - \*\*\`none\`\*\* -- rules are not injected at all. This mode requires a \`merge\_bot\_account\` on the queue rule, since Mergify must merge with an account able to satisfy the protections itself. ### Bypass Actors If you are using GitHub rulesets (not classic branch protections), add Mergify as a \*\*bypass actor\*\* on the ruleset. The bypass mode you give it decides what the merge queue may do: - \*\*\`exempt\`\*\* covers everything, and is the only mode that works for \[GitHub-native stacked pull requests\](#github-native-stacked-pull-requests). - \*\*\`always\`\*\* covers everything except GitHub-native stacked pull requests. - \*\*\`pull\_requests\_only\`\*\* covers only what Mergify does through a pull request. The merge queue also creates, pushes to, and deletes its own queue branches, and those are raw ref operations, so this mode still blocks the queue. Choose \`exempt\` unless you have a reason not to. See \[Configuring Mergify as a Bypass Actor\](#configuring-mergify-as-a-bypass-actor) for the steps. ### Bypass Actors and Injection A bypass actor entry lets the merge queue work on your branches. Beyond merging pull requests, the queue runs raw ref operations on its own queue branches, which are prefixed with \`mergify/merge-queue/\` by default, so a ruleset that covers those branches blocks the queue until you either narrow the ruleset so it no longer matches them, or add Mergify as a bypass actor with the \`exempt\` or \`always\` bypass mode. See \[Bypass Actors\](#bypass-actors) for what each mode covers, and \[Configuring Mergify as a Bypass Actor\](#configuring-mergify-as-a-bypass-actor) for the steps. With the \[\`fast-forward\` merge method\](/merge-queue/merge-strategies#fast-forward), Mergify advances the target branch itself by a direct ref update, so a ruleset on that branch also needs the \`exempt\` or \`always\` bypass mode. Narrowing the ruleset is not an option there, since the branch the rules protect is the one being updated. Bypassing and injection are different controls. A bypass mode decides what GitHub lets Mergify \*do\*; injection decides what Mergify \*requires\* before it merges, and the two are set in different places: - Injection reads the branch protections and rulesets that apply to the target branch and turns the supported rules into merge conditions. - \[\`branch\_protection\_injection\_mode\`\](/configuration/file-format/#queue-rules) controls it, and \[Controlling Injection\](#controlling-injection) covers its modes. It is set per queue rule and covers everything Mergify detects on the branch, so it turns injection off for every rule there or for none of them. If a single rule should not gate your queue, take it out of the ruleset or scope the ruleset so it no longer targets the branch. That is the one control that acts on exactly one rule. :::caution Narrowing Mergify's bypass mode is not a way to drop a requirement from your merge conditions. The mode decides what GitHub lets Mergify \*do\*, so narrowing it blocks the queue. When a requirement should not gate your queue, take the rule out of the ruleset or scope the ruleset so it no longer targets the branch. ::: ## Review Requirements GitHub has no API that answers "is this ruleset satisfied". The closest thing is the GraphQL \`pullRequest.reviewDecision\` field, and GitHub only publishes a decision there when a rule on the base branch requires at least one approving review. When the required approval count is \`0\`, the field stays \`null\` even while GitHub keeps blocking the merge. So Mergify reads GitHub's verdict where GitHub publishes one, and rebuilds the gate from the pull request's own reviews where it does not. Which of the two applies is decided \*\*per base branch, not per ruleset\*\*. Mergify takes the highest \`required\_approving\_review\_count\` across every active \`pull\_request\` rule on the branch, from classic branch protection and from every ruleset alike. A single ruleset asking for one approval puts the whole branch on GitHub's verdict. A ruleset Mergify can bypass counts like any other. That branch-wide count decides which verdict \`github-review-approved\` reads. Whether a given rule also contributes a code owner or last-push condition is decided from that rule's own count, so a branch on GitHub's verdict can still carry a local \`CODEOWNERS\` condition injected by a second rule that requires no approvals. Review requirements also collide with two queue features whatever the count. See \[Review Requirements and Fast-Forward\](#review-requirements-and-fast-forward) and \[In-Place Checks and Review Requirements\](#in-place-checks-and-review-requirements). ### At Least One Required Approval \[\`github-review-approved\`\](/configuration/conditions#github-rulesets-and-branch-protection-attributes) mirrors \`reviewDecision\`. GitHub has already applied reviewer eligibility, \`CODEOWNERS\` ownership, the rule's own approval-freshness options, and active change requests, so the condition Mergify evaluates and GitHub's own merge button agree. \`require\_code\_owner\_review\` needs no condition of its own in this case: GitHub folds code owner review into the decision it publishes. \`require\_last\_push\_approval\` does get a condition, \[\`github-require-last-push-approval\`\](/configuration/conditions#github-rulesets-and-branch-protection-attributes), so you can see the requirement in the check summary, but it reads the same decision rather than checking anything separately. If Mergify cannot read the decision at all, it treats the pull request as not approved rather than merging it. ### No Required Approval At \`required\_approving\_review\_count: 0\`, a \`pull\_request\` rule still enforces its other requirements, a blocking review, code owner review, and approval of the most recent push, against anyone who cannot bypass it. GitHub just stops publishing a verdict, so Mergify rebuilds most of them from the pull request's reviews. Each requirement Mergify does rebuild is deliberately fail-safe: it can hold a pull request GitHub would have let through, and it never lets one merge that GitHub would have blocked. The symptom is a pull request Mergify is still waiting on while GitHub reports it as mergeable. | Requirement | Enforced by Mergify at \`0\` approvals | Where Mergify differs from GitHub | |---|---|---| | A blocking review | Yes | Stricter: reviewer eligibility is approximated by a write-access check | | Code owner review | Yes | Stricter: an owner that resolves to no GitHub login can never satisfy its file | | Approval of the most recent push | \*\*No\*\* | \*\*Looser: a pull request can merge with an unapproved latest push\*\* | :::caution Approval of the most recent push is the only review requirement on this page that a pull request can merge without. Require at least one approving review on the rule if the latest push must be approved before a merge. ::: \*\*A blocking review.\*\* \`github-review-approved\` is \`false\` while a reviewer with write access or above has an active \*Request changes\*. Only each reviewer's most recent review counts, and bot reviews are advisory. Mergify approximates GitHub's reviewer eligibility with that write-access check, so it can hold a pull request on a review GitHub would disregard. \*\*Code owner review.\*\* \[\`github-code-owner-review-satisfied\`\](/configuration/conditions#github-rulesets-and-branch-protection-attributes) reads \`CODEOWNERS\` itself: for each file the pull request touches it takes the owners of the last matching entry, and is satisfied when one of them approved and none requested changes. Both paths of a rename count. An owner it cannot resolve to a GitHub login, such as a bare email address or a team in another organization, can never satisfy the file, so its approval does not count. When no owner of a file resolves, the check summary names the entry; when another owner does resolve, the pull request waits for that owner's approval with nothing to say why. \*\*Approval of the most recent push.\*\* Mergify does not inject \`github-require-last-push-approval\` when the required approval count is \`0\`. GitHub keeps blocking anyone who cannot bypass the rule, but where Mergify bypasses it, as the \[bypass actor\](#bypass-actors) setup this page recommends, nothing checks the latest push. Requiring at least one approving review is what makes Mergify honor the option. \*\*Reviews from named teams or users.\*\* These are not in the table because the approval count never decides them. This is the rule's \*\*Required reviewers\*\* setting, and GitHub publishes no status for it at any count, so Mergify always evaluates \`github-require-review-from-specific-teams\` itself, as covered in \[Required Reviewers\](#required-reviewers). A team or user ID the ruleset names but Mergify cannot resolve makes the condition \`false\`, so the misconfiguration blocks instead of being skipped. ### Required Reviewers A \`pull\_request\` ruleset rule can require approvals from specific teams or users (the rule's \*\*Required reviewers\*\* setting). Mergify detects this and injects the \[\`github-require-review-from-specific-teams\`\](/configuration/conditions#github-rulesets-and-branch-protection-attributes) boolean condition, so a pull request is merged only once those approvals are in. The condition is \`true\` when every required reviewer is satisfied: - each required \*\*team\*\* has at least the requested number of approvals from its members, and - each required \*\*user\*\* has approved the pull request. When the requirement is scoped to a subset of files (the ruleset's \`file\_patterns\` field), it only applies to pull requests that touch a matching file. Other pull requests are unaffected. Mergify injects this condition itself, and you cannot write it in your own conditions: a configuration that references it is rejected when it is validated. :::note The condition evaluates to \`false\` if a ruleset entry points to a team or user that no longer exists, so the misconfiguration surfaces instead of being silently skipped. Fix the ruleset to remove the stale reviewer. ::: ## Ruleset Rule Compatibility Mergify handles each GitHub ruleset rule type as follows. | Ruleset rule type | Mergify behavior | Notes | |---|---|---| | \`required\_status\_checks\` | Injected as conditions | See \[below\](#require-branches-to-be-up-to-date) | | \`pull\_request\` | Injected as conditions | Depends on the approval count. See \[above\](#review-requirements) | | \`merge\_queue\` (GitHub native) | \*\*Incompatible\*\* | See \[below\](#github-native-merge-queue-rule) | | \`creation\` | Checked on queue branch creation | See \[below\](#required-signatures-and-branch-deletion) | | \`update\` | Checked on queue branch creation | See \[below\](#required-signatures-and-branch-deletion) | | \`branch\_name\_pattern\` | Checked on queue branch creation | See \[below\](#branch-name-pattern) | | \`required\_review\_thread\_resolution\` | Injected as conditions | -- | | \`required\_signatures\` | Checked on queue branch push | See \[below\](#required-signatures-and-branch-deletion) | | \`deletion\` | Checked when queue branches are cleaned up | See \[below\](#required-signatures-and-branch-deletion) | | All other rule types | Ignored | See \[below\](#ignored-rule-types) | Mergify supports only the ruleset rule types named above. Every other rule type is ignored: Mergify neither injects it as a condition nor checks it for compatibility. Do not assume full ruleset parity. See \[Ignored Rule Types\](#ignored-rule-types) for how to enforce a rule Mergify does not handle. :::caution Branch protection support has some limitations. For example, GitHub does not provide an API to support \[code owners\](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners), which makes it unreliable in certain circumstances. ::: ## Known Incompatibilities ### GitHub-Native Stacked Pull Requests Merging \[GitHub-native stacked pull requests\](/merge-queue/stacks#github-native-stacked-pull-requests) requires the \`exempt\` bypass mode. With any other bypass mode, the merge queue refuses the pull request. \*\*Resolution:\*\* - Set Mergify's bypass mode to \*\*Exempt\*\* on every ruleset that applies to the base branch. ### GitHub Native Merge Queue Rule If the \`merge\_queue\` ruleset rule (GitHub's built-in merge queue) is enabled on the target branch and Mergify is \*\*not\*\* a bypass actor, GitHub blocks Mergify from merging pull requests -- all merges must go through GitHub's own queue. \*\*Resolution:\*\* - \*\*Preferred:\*\* disable the \`merge\_queue\` ruleset rule on branches where you use Mergify's merge queue. - \*\*Alternative:\*\* add Mergify as a bypass actor on that ruleset with the \`exempt\` bypass mode. This lets Mergify merge directly while GitHub's queue is still active for other actors. ### Branch Name Pattern If a \`branch\_name\_pattern\` ruleset rule matches Mergify's queue branches and Mergify is \*\*not\*\* a bypass actor with the \`exempt\` or \`always\` bypass mode, GitHub blocks Mergify from creating queue branches. As a result, Mergify cannot queue or merge pull requests targeting that branch. Creating a branch is a raw ref operation, which is why \`pull\_requests\_only\` does not unblock it. Queue branches are prefixed with \`mergify/merge-queue/\`, customizable via \`queue\_branch\_prefix\` in \[\`queue\_rules\`\](/configuration/file-format/#queue-rules). The error Mergify reports names the queue branch that was refused, so you know which pattern to narrow. \*\*Resolution:\*\* - \*\*Preferred:\*\* add Mergify as a bypass actor on the ruleset with the \`exempt\` bypass mode. - \*\*Alternative:\*\* narrow the ruleset pattern so it excludes \`mergify/merge-queue/\*\`. If you customized \[\`queue\_branch\_prefix\`\](/configuration/file-format/#queue-rules), substitute your prefix. :::note Mergify also periodically deletes leftover queue branches that match these prefixes. See \[Queue Branch Cleanup\](/merge-queue/lifecycle#queue-branch-cleanup) for how branches are matched and an important caveat about naming your own branches. ::: ### Required Signatures and Branch Deletion Mergify builds each queue branch locally and pushes it, then deletes it once the batch is done. Neither goes through a pull request, so a ruleset covering the queue branch prefixes can stop the queue: - A \`required\_signatures\` rule rejects the push, because the commits Mergify composes locally are unsigned. Every queue attempt then fails on branch creation. - A \`deletion\` rule stops Mergify from removing the final queue branch before recreating it, which leaves the queue stuck on that batch. - A \`creation\`, \`update\`, or \`pull\_request\` rule refuses the queue branch outright, whatever the rule itself asks for. A \`pull\_request\` rule counts here because the queue branch is pushed, never opened as a pull request of its own, so the rule can never be satisfied on it. Unlike the push and the deletion, any bypass mode clears these three, \`pull\_requests\_only\` included. \*\*Resolution:\*\* - \*\*Preferred:\*\* add Mergify as a bypass actor on the ruleset with the \`exempt\` or \`always\` bypass mode. \`pull\_requests\_only\` is not enough for the push or the deletion. - \*\*Alternative:\*\* narrow the ruleset so it does not cover the queue branch prefixes. ### Require Branches to Be Up to Date The \`strict\_required\_status\_checks\_policy\` setting (labeled \*Require branches to be up to date before merging\* in the GitHub UI) is incompatible with \[parallel checks\](/merge-queue/performance#parallel-checks) and \[batches\](/merge-queue/batches) when using batch PR checks. Mergify creates temporary batch PRs to test combined changes. The original pull requests are merged after those checks pass, but GitHub considers them "not up to date" because they were not the branches that were tested. This setting blocks the merge. :::note Disabling this setting does \*\*not\*\* mean Mergify tests outdated code. Mergify always updates pull requests against the latest base branch before testing. ::: \*\*Resolution:\*\* - \*\*Preferred:\*\* disable the \*Require branches to be up to date before merging\* setting. - \*\*Alternative:\*\* add Mergify as a bypass actor on the ruleset with the \`exempt\` bypass mode. - \*\*Alternative:\*\* use the \[\`fast-forward\` merge method\](/merge-queue/merge-strategies#fast-forward), which merges the queue branch directly and is not affected by this setting. - \*\*Alternative:\*\* use \[in-place checks\](/merge-queue/batches#in-place-checks-no-batch-prs), which test PRs on their own branch without creating temporary batch PRs. Note that in-place checks require \`batch\_size: 1\`, \`max\_parallel\_checks: 1\` and serial mode, so this resolution means giving up the batches or parallel checks that caused the conflict rather than keeping them. ### Injection Mode \`merge\` and Required Status Checks With \[\`branch\_protection\_injection\_mode: merge\`\](#controlling-injection), the queue runs the required checks on the batch PR and then merges the original one. GitHub enforces the ruleset's \`required\_status\_checks\` rule against that original pull request, which never carried those checks, so it refuses the merge and the queue reports an incompatibility error. This only arises when the batch PR is not itself what lands. A queue using the \[\`fast-forward\`\](/merge-queue/merge-strategies#fast-forward) or \[\`merge-batch\`\](/merge-queue/merge-strategies#merge-batch) merge method merges the batch PR, so GitHub enforces the checks against the head that ran them. \[In-place checks\](/merge-queue/batches#in-place-checks-no-batch-prs) are clear too: they run on the original pull request, so again the head that lands is the head that ran the checks. \*\*Resolution:\*\* - \*\*Preferred:\*\* add Mergify as a bypass actor on the ruleset, as the \[recommended setup\](#recommended-ruleset-setup) already calls for. Every bypass mode clears this one. - \*\*Alternative:\*\* leave \`branch\_protection\_injection\_mode\` at its default, \`queue\`. ### Review Requirements and Fast-Forward The \`required\_approving\_review\_count\`, \`require\_code\_owner\_review\`, and \`require\_last\_push\_approval\` ruleset rules are incompatible with the \[\`fast-forward\` merge method\](/merge-queue/merge-strategies#fast-forward) when using batch PR checks (the default for parallel checks and batches). When Mergify uses batch PR checks, it creates temporary batch PRs to test changes. These batch PRs do not carry the review approvals from the original PRs, so GitHub blocks the fast-forward push if review requirements are enforced. \*\*Resolution:\*\* - Add Mergify as a bypass actor on the ruleset that enforces review requirements, with the \`exempt\` or \`always\` bypass mode. ### In-Place Checks and Review Requirements When using \[in-place checks\](/merge-queue/batches#in-place-checks-no-batch-prs) (where Mergify tests a PR on its own branch), a \`pull\_request\` ruleset rule that enforces review requirements on the PR's \*\*head\*\* branch stops Mergify from checking the PR, and the queue reports an incompatibility error. Adding Mergify as a bypass actor does not resolve it, since the check looks at whether the rule is set rather than at who may bypass it. PRs opened from a fork are not affected. \*\*Resolution:\*\* - Drop the review requirement from the ruleset that targets the head branches you queue, or stop using in-place checks on that queue. ## Ignored Rule Types The following ruleset rule types are not processed by Mergify. They are neither injected as conditions nor validated for compatibility. If these rules are active on your branches, Mergify will not enforce them: - \`required\_deployments\` - \`required\_linear\_history\` - \`non\_fast\_forward\` - Pattern and file rules (\`commit\_message\_pattern\`, \`file\_path\_restriction\`, \`max\_file\_path\_length\`, \`file\_extension\_restriction\`) - \`workflows\` - \`code\_scanning\` Mergify as a \[bypass actor\](#bypass-actors), which the \[recommended setup\](#recommended-ruleset-setup) calls for, covers the whole ruleset, so GitHub does not apply these rules to a merge the queue performs either. If you rely on one of them, put the requirement behind a CI check and require that check with a \`required\_status\_checks\` rule, which Mergify does inject, so your branch rules stay in the ruleset. Fall back to a \[merge condition\](/configuration/conditions) only for a requirement no ruleset rule can express. Two of them need a different answer. \`required\_linear\_history\` and \`non\_fast\_forward\` constrain the ref update rather than the pull request, so no condition or check reproduces them. GitHub still enforces both against every other actor; to keep the queue's own merges linear, pick a \[\`merge\_method\`\](/merge-queue/merge-strategies) that does not create a merge commit. ## Configuring Mergify as a Bypass Actor To add Mergify as a bypass actor on a GitHub ruleset: 1. Go to your repository \*\*Settings > Rules > Rulesets\*\*. 2. Select the ruleset you want to modify (or create a new one). 3. Under \*\*Bypass list\*\*, click \*\*Add bypass\*\*. 4. Search for the \*\*Mergify\*\* app and select it. 5. Choose \*\*Exempt\*\* as the bypass mode. 6. Save the ruleset. Bypass actors are configured per ruleset, so repeat this on every ruleset that applies to the branches you queue. --- # Unknown \--- title: Pull Request Lifecycle description: Understand the lifecycle of a pull request before and once it enters a merge queue. --- This page explains what happens to a pull request (PR) once it enters the merge queue, from the moment it's added until it's either merged or removed from the queue. It also covers how to monitor and manage your merge queue, and how to handle common scenarios such as requeueing and dequeueing PRs. ## Adding a Pull Request to the Merge Queue A pull request can be added to the merge queue either manually or automatically. Here's an overview of the process: - \*\*Manual addition:\*\* A pull request can be manually added to the merge queue using the \[\`@mergifyio queue\` command\](/commands/queue) or by ticking the \[\*\*Queue this pull request\*\* checkbox\](/commands/queue#queueing-with-a-checkbox), which Mergify posts in a comment of its own once the pull request is ready to be queued. - \*\*Automated addition:\*\* A pull request can be automatically added to the merge queue using \[\`auto\_merge\_conditions\`\](/merge-protections/auto-merge) in \`merge\_protections\_settings\`. Before a pull request can be added to the merge queue, it must meet certain conditions, specified under \`queue\_conditions\` in your \[\`queue\_rules\`\](/merge-queue/rules). These conditions might include requirements such as passing all checks, having a certain number of approved reviews, or having specific labels. Once a pull request meets the specified queue conditions, it is added to the end of the merge queue. However, \[priority rules\](/merge-queue/priority) can be used to alter its position in the queue. \`\`\`dot class="flow" title="A pull request's states in the merge queue, and what moves it between them" digraph { node \[width=1.8\]; Dequeued \[class="external"\]; Queueing \[class="pending"\]; Queued \[class="queued"\]; Validating \[class="pending"\]; Merged \[class="merged"\]; Dequeued -> Queueing \[label=" queue command\\l or auto\_merge\\l"\]; Queueing -> Queued \[label=" matches\\l queue\_conditions\\l"\]; Queued -> Validating \[label=" reaches the top\\l of the queue\\l"\]; Validating -> Merged \[label=" matches\\l merge\_conditions\\l", class="merged"\]; Queued -> Dequeued \[label=" unmatches queue\_conditions\\l or dequeue command\\l", class="failed"\]; Validating -> Dequeued \[label=" fails merge\_conditions\\l or dequeue command\\l", class="failed"\]; } \`\`\` ## Lifecycle of a Pull Request in the Merge Queue The lifecycle of a pull request in the merge queue begins as soon as it enters the queue. 1. \*\*Position in the queue:\*\* The pull request assumes its position in the queue based on the order in which it entered. As mentioned in the previous section, the order may be influenced by any defined \[priority rules\](/merge-queue/priority). 2. \*\*Waiting for its turn:\*\* The pull request waits in the queue until it is its turn to merge. In the default \[serial mode\](/merge-queue/queue-modes), merges happen in queue order, one \[batch\](/merge-queue/batches) at a time, but the testing that precedes them does not: \`merge\_queue.max\_parallel\_checks\` defaults to \`5\`, so Mergify tests up to five batches at once with \[parallel checks\](/merge-queue/performance#parallel-checks). At the default \`batch\_size\` of 1, that is five queued pull requests. Set \`max\_parallel\_checks\` to \`1\` to test them strictly one after the other. In parallel and isolated modes, batches that do not depend on each other merge as soon as their own checks pass, rather than in strict queue order. 3. \*\*Validating the pull request:\*\* When a pull request is next in line, it enters the validation phase. During this phase, the Mergify engine will temporarily merge it with the base branch, re-triggering the CI system. Before the actual merge happens, it will check that the \`merge\_conditions\` specified in the configuration file are satisfied. This ensures that only pull requests that meet the necessary conditions are merged. 4. \*\*Merge success or failure:\*\* - If the validation is successful, meaning all the \`merge\_conditions\` are met, the pull request leaves the queue and is merged into the base branch. - If the merge is not successful, the pull request is removed from the queue. This could be due to various reasons, such as conflicts with the base branch or a check failure. ## Removing a Pull Request from the Merge Queue A pull request can be removed from the merge queue in a couple of ways: 1. \*\*Non-compliance with \`queue\_conditions\`:\*\* If a pull request no longer meets the \`queue\_conditions\` specified in the Mergify configuration file, it will automatically be removed from the queue. For instance, if one of the \`queue\_conditions\` is the presence of a specific label, and that label gets removed from the pull request, Mergify will automatically remove the pull request from the queue. 2. \*\*Use of the \[\`dequeue\` command\](/commands/dequeue):\*\* A pull request can be manually removed from the queue by issuing the \`@mergifyio dequeue\` command. This is particularly useful in situations where you need to stop a pull request from being merged, such as when a critical issue is discovered. Please note, a pull request removed from the queue with the \`dequeue\` command will not rejoin the queue automatically; it will need to be manually re-added to the queue by re-applying the \`queue\` command and by re-satisfying the \`queue\_conditions\`. These methods provide granular control over your merge queue, ensuring that only the appropriate pull requests get processed and merged. ## Conflicts with a Pull Request Ahead When Mergify builds a \[batch\](/merge-queue/batches), it merges the queued pull requests together on a temporary branch. That composition can hit a conflict between a pull request and another one ahead of it in the queue. Mergify does not remove the pull request in that case. As long as the pull request it conflicts with is still in the queue, the conflicting one is \*held\*: it keeps its place, its check run reports that its checks are deferred, and the status comment names the pull requests it is waiting on. What happens next depends on the pull request ahead: - \*\*It leaves the queue without merging.\*\* The conflict never reaches the base branch, so Mergify puts the held pull request back into a batch and its checks resume. - \*\*It merges.\*\* Its changes are now part of the base branch, so the conflict is confirmed: the held pull request becomes conflicting with the base branch and is removed from the queue. Update or rebase it, then queue it again. Two other conflicts remove the pull request from the queue immediately, without holding it: a conflict with the base branch itself, and a conflict with a pull request that has already left the queue. :::note A deferred pull request is still queued, so it holds its position: it keeps the \[\`queued\_label\`\](#queue-labels) and is not given the \`dequeued\_label\`. The \`checking\_label\`, if you set one, comes off until the pull request is put back into a batch. It is waiting for its turn, so there is nothing to requeue. ::: ### Resolving Some Conflicts Automatically Some conflicts have a mechanical answer: a changelog that only ever grows, a generated file that is rewritten wholesale. \`conflict\_resolvers\` on a queue rule names those files and how to merge them, and Mergify resolves them while composing the batch instead of holding the pull request. \`\`\`yaml queue\_rules: - name: default merge\_method: merge-batch batch\_size: 5 conflict\_resolvers: - paths: - CHANGELOG.md strategy: union \`\`\` The strategy names follow git's merge drivers. \*Ours\* is always the batch as it already stands — the base branch plus the pull requests ahead — and never the pull request being added to it: \`paths\` takes \[glob patterns\](/configuration/data-types#globs) matched from the repository root, so \`\*.md\` covers Markdown files at the root and \`docs/\*\*\` everything under \`docs/\`. When several entries match the same file, the last one wins. A conflict on a file no resolver matches holds the pull request exactly as described above. A few pattern shapes carried over from \`.gitattributes\` are rejected as configuration errors rather than quietly matching nothing. A pattern that starts with a separator (\`/src/\*\*\` or \`./src/\*\*\`) is rejected, since patterns are already relative to the repository root, so drop the leading separator. A pattern that ends with one (\`docs/\`) is rejected because patterns match files, not directories, so write \`docs/\*\*\` instead. The separator checks run on each brace alternative, so \`{/a,b}\` is rejected too. An empty pattern is rejected, as is one that matches no path at all, such as \`{}\`. :::caution Resolvers only take effect when the batch branch Mergify built is what lands, which means \`merge\_method\` set to \`merge-batch\` or \`fast-forward\`. With \`merge\`, \`squash\` or \`rebase\`, each pull request is merged at its own head and GitHub recomputes that merge, so a resolution made while building the batch would never reach your base branch. The configuration stays valid and nothing is resolved. ::: :::note Your repository's own \`.gitattributes\` has no effect here. Mergify composes a batch in a bare clone with no working tree, which is the one case where git does not read a committed attributes file, so a \`merge=union\` already declared there is not applied, and neither is a merge attribute that a queued pull request grants itself. \`conflict\_resolvers\` is the only way in. ::: ## Checks Timeout When a pull request reaches the front of the queue, Mergify validates it by re-running your CI against a temporary merge commit. If those checks never report back (because of a stuck CI job or a provider outage), the pull request would block the queue indefinitely. The \`checks\_timeout\` option in your \[\`queue\_rules\`\](/merge-queue/rules) caps how long Mergify waits for pending checks before removing the pull request from the queue. You can set \`checks\_timeout\` in three ways: - \*\*\`auto\`\*\* (the default): Mergify computes the timeout from the queue's own recent CI runtime, using the 95th-percentile duration of successful runs with a safety margin. The runtime is measured per queue \*and\* per base branch, over the last seven days, with recent runs weighted more heavily. Two branches served by the same queue can end up with different timeouts. Only first attempts feed that calculation: a run that was \[retried\](#automatic-ci-retries) after a failure, or that tested a batch from a \[bisection\](/merge-queue/batches#handling-batch-failure-or-timeout), measures recovery work rather than a normal run, so Mergify leaves it out of the measurement. The timeout it produces still applies to every attempt, retries and bisections included. The value adapts as your CI gets faster or slower, so you don't have to guess one. Until the queue has gathered enough CI history on the branch (around twenty qualifying runs in that seven-day window), \`auto\` applies no timeout. - \*\*A fixed \[duration\](/configuration/data-types#duration)\*\*, such as \`30 min\` or \`2 hours\`. The timeout cannot be shorter than 60 seconds. - \*\*\`null\`\*\*, which disables the timeout. Mergify waits on pending checks indefinitely. \`\`\`yaml queue\_rules: - name: default checks\_timeout: 45 min \`\`\` :::note \`auto\` is the default. Before it existed, a queue without a \`checks\_timeout\` had no timeout and would wait on pending checks indefinitely. Queues that already set an explicit duration, or \`null\`, keep their configured behavior. Because \`auto\` applies no timeout until a queue has built up CI history, set an explicit duration if you want a guaranteed timeout on a brand-new queue. The same holds for a queue that merges only a handful of pull requests a week on a given branch, and for one whose recent runs were mostly retries or bisections, since those don't count toward that history. ::: When a pull request is dequeued because its checks timed out, Mergify reports it under the \[\`checks-timeout\`\](/configuration/data-types#queue-dequeue-reason) dequeue reason, states how long it waited, and lists the checks that were still running alongside those that never reported at all. A check that never reports can never satisfy its merge condition, so that second list usually means a check name in your \`merge\_conditions\` doesn't match what your CI publishes. When the timeout came from \`auto\`, the report says so ("the checks did not pass within the automatic checks timeout of 45 minutes, derived from this queue's recent CI runtime") and points at \`checks\_timeout\` so you can set your own value or \`null\` to disable it. A configured duration is reported on its own, with no mention of where it came from. For batches, see \[Handling Batch Failure or Timeout\](/merge-queue/batches#handling-batch-failure-or-timeout). ## Automatic CI Retries Flaky CI can remove a pull request that would otherwise merge cleanly. The \`max\_checks\_retries\` option in your \[\`queue\_rules\`\](/merge-queue/rules) tells Mergify how many times to retry failed CI checks before removing the pull request from the queue. On each retry, Mergify recreates the draft pull request to trigger a fresh CI run. \`\`\`yaml queue\_rules: - name: default max\_checks\_retries: 3 \`\`\` \`max\_checks\_retries\` defaults to \`0\`, which disables retries and keeps the normal failure handling described below. When you set it greater than \`0\`, Mergify always creates a draft pull request and disables in-place checks, since each retry needs a fresh draft to run against. The queue status report shows the current attempt number, for example "attempt 2/3". ## Handling PRs that Fail Validation Checks Even with all the automated checks and balances in place, it's possible for a pull request to fail the validation checks. This could be due to a wide range of issues, such as coding errors, conflicts with the base branch, failing CI tests, or not meeting certain \`merge\_conditions\`. When this happens, the pull request is removed from the queue, and Mergify informs the pull request author and reviewers about the failure. Here's how to handle such situations: 1. \*\*Review the failure reasons\*\*: Mergify will provide a detailed report outlining why the pull request failed the checks. You should start by \[reviewing these details to understand what went wrong\](#monitoring-the-status-of-prs-in-the-merge-queue). 2. \*\*Update the pull request\*\*: Once you've identified the issue, the next step is to fix it. This might involve updating the code, resolving merge conflicts, or making other necessary changes to the pull request. 3. \*\*Re-run the checks\*\*: After updating the pull request, the validation checks need to be re-run. If you're using a continuous integration (CI) system, it will likely automatically run the checks again once the pull request is updated. 4. \*\*Requeue the pull request\*\*: Once all the issues have been resolved and the validation checks pass, the pull request needs to be requeued. You can do this by issuing the \`@mergifyio queue\` command. By carefully addressing each failed check and ensuring all the issues are fixed, you can maintain the integrity of your codebase while ensuring that every pull request is ready to be merged when it's time. ### Interrupted Checks An interrupted check is the exception to the steps above. When a check blocking the merge conditions was cancelled before reaching any conclusion (a reclaimed runner, a cancelled workflow run), Mergify removes the pull request under the \[\`checks-interrupted\`\](/configuration/data-types#queue-dequeue-reason) dequeue reason rather than \`checks-failed\`, and names the checks that never reached a verdict. Nothing about the pull request needs fixing: requeue it with \`@mergifyio queue\`, without updating it, and the check runs again. \[Automatic CI retries\](#automatic-ci-retries) come first, so a queue with \`max\_checks\_retries\` set only reports the interruption once its retries are spent. A check that reported a failure of its own is a failure rather than an interruption, and so is a check that timed out on its own (a \`timed\_out\` conclusion, matched by \[\`check-timed-out\`\](/configuration/conditions#attributes-list)): it used up its own time rather than being stopped from outside. When a check fails and another is interrupted at the same time, the failure wins, and the pull request is removed under \`checks-failed\`. ## Requeuing a Pull Request in the Merge Queue At times, you might find it necessary to requeue a pull request. This could happen when a pull request is removed from the queue because it failed to meet the \`merge\_conditions\` of the queue it was in. This typically happens when a check failed because of a flaky test; the PR is removed from the queue whereas it might have been mergeable. In that case, the PR might be re-added to the merge queue to try again by using the \[\`@mergifyio queue\` command\](/commands/queue), which will reset its status to a neutral state so Mergify is happy to retry it. Once issued, the command will place the pull request back in the merge queue according to the queue's \`queue\_conditions\`. ## Base Branch Updates The merge queue tests pull requests against the latest version of the base branch. Therefore, if a new commit is pushed manually to the base branch, Mergify resets the process and starts over with the updated base branch. This can be disabled by setting \`reset\_on\_external\_merge: never\` in your configuration file: \`\`\`yaml merge\_queue: reset\_on\_external\_merge: never \`\`\` ## Queue Branch Cleanup To test a pull request, Mergify creates a queue branch, runs the required checks against it, and deletes that branch once the pull request leaves the queue. This deletion is normally immediate, triggered by a GitHub webhook. When that deletion fails, the queue branch is left behind. To keep these orphaned branches from piling up, Mergify periodically scans your repository for leftover queue branches and deletes them in the background. There is nothing to clean up by hand. ### How Leftover Branches Are Matched Mergify identifies a leftover queue branch by its name alone. A branch is deleted only when \*\*both\*\* of the following are true: - Its name is the \[\`queue\_branch\_prefix\`\](/configuration/file-format/#queue-rules), followed by exactly 10 hexadecimal characters (\`0\`–\`9\`, \`a\`–\`f\`). - It is not in use by an active queue. With the default prefix, a matching branch looks like \`mergify/merge-queue/a76b1f3d25\`. With a custom \`queue\_branch\_prefix\` such as \`mergify-\`, it looks like \`mergify-a76b1f3d25\`. A CI retry generates a fresh name of the same shape, with no extra suffix. Only that shape is matched. A queue branch is pushed straight to its final name, and a branch whose name merely starts with your prefix is left alone. :::caution Matching is by name only: Mergify does not track which branches it created. A branch \*\*you\*\* create will be deleted if its name matches the pattern above. Avoid naming your own branches this way. ::: ## Monitoring the Status of PRs in the Merge Queue To keep track of the status and progress of your pull requests in the merge queue, Mergify provides multiple tools and indicators. Here's how you can use them: 1. \*\*Check the Mergify dashboard:\*\* The \[Mergify dashboard\](https://dashboard.mergify.com) provides a full view of your queue. You can see the number of pull requests in each queue and their position. ![Mergify queue status](https://docs.mergify.com/merge-queue/%7BqueueStatusScreenshot%7D) 2. \*\*Check the Mergify checks tab on the PR:\*\* On each pull request page, the "checks" tab will show the status of the Mergify checks. A queued pull request has a "Mergify Merge Queue" check run whose title shows its state: "In merge queue" while it waits its turn, "Running merge queue checks" while its batch is being tested. ![Mergify check status](https://docs.mergify.com/merge-queue/%7BqueueCheckScreenshot%7D) Monitoring your pull requests' status helps you understand their position in the queue and estimate when they might be merged. ## The Mergify Merge Queue Check Run Every pull request in a repository with the merge queue enabled shows a single "Mergify Merge Queue" check run. This check consolidates the pull request's queue status, whether it is queued, waiting for conditions, or has been dequeued, into one consistent check. You can read it from the "checks" tab alongside the other Mergify statuses. ## Queue Labels Mergify can label a pull request according to where it stands in the queue. Three options under \`merge\_queue\` control this, and each takes the name of the label to apply: - \*\*\`queued\_label\`\*\* (\`queued\` by default): applied while the pull request sits in the queue, from the moment it is queued until it leaves. - \*\*\`checking\_label\`\*\* (no label by default): applied while the queue is actually checking the pull request, that is, while it is embarked in a batch. It stays on a pull request parked in a \[bisection\](/merge-queue/batches#handling-batch-failure-or-timeout), whose own CI has not started yet. It comes off if the pull request goes back to waiting in the queue, and again when it leaves the queue. - \*\*\`dequeued\_label\`\*\* (\`dequeued\` by default): applied once the pull request has been removed from the queue. Set an option to the label you want, or leave it unset for no label: \`\`\`yaml merge\_queue: queued\_label: queued checking\_label: checking dequeued\_label: dequeued \`\`\` Where \`queued\_label\` marks everything in the queue, \`checking\_label\` narrows that down to the pull requests the queue is working on right now, so you can tell at a glance which ones are consuming CI capacity. ## Status Comments Mergify posts status comments on each pull request in the queue to report its progress. The \`status\_comments\` option in your \`merge\_queue\` settings controls how much Mergify posts: - \*\*\`all\`\*\* (the default): comments for every queue event, including entering the queue, CI progress, and final outcomes. - \*\*\`outcomes\`\*\*: comments only for final outcomes, such as a merge or a dequeue with its failure reason. - \*\*\`none\`\*\*: no status comments. \`\`\`yaml merge\_queue: status\_comments: outcomes \`\`\` ### When the Merge Lands Nothing A merge does not always move the base branch. When an equivalent change landed ahead of a queued pull request, \[rebasing\](/merge-queue/merge-strategies#rebase) it drops every one of its commits as empty, and the merge leaves the base branch exactly where it was. GitHub still marks the pull request merged, and its \*\*Files changed\*\* tab still shows the whole diff, because that diff is computed against the merge base rather than against the current tip of the base branch. The status comment for the merge opens with a \*\*Nothing landed\*\* section that says both of those things, so the author learns the change shipped nothing before reading the rest of the report. --- # Unknown \--- title: Performance description: Optimizing your merge queue for maximum efficiency. --- Tune parallel checks, batch size, and CI scope to balance throughput, reliability, and CI cost. :::tip Scaling to 20+ PRs per day? The \[Merge Queue Academy's high-velocity teams guide\](https://merge-queue.academy/use-cases/high-velocity-teams/) covers health metrics and optimization strategies for fast-moving teams. ::: ## Parallel checks Parallel checks are how Mergify tests the queue \*\*speculatively\*\*: instead of validating one pull request at a time, it tests several queued pull requests ahead of time so you ship faster. Mergify creates temporary batch PRs that represent cumulative merges (PR #1), (PR #1 + PR #2), (PR #1 + PR #2 + PR #3), runs CI on them in parallel, then merges the original PRs once checks pass. If a batch fails, Mergify removes the culprit PR and continues with the rest. Set \`merge\_queue.max\_parallel\_checks\` to control how many speculative checks run at once: \`\`\`yaml merge\_queue: max\_parallel\_checks: 3 \`\`\` Higher values increase concurrency; choose a value your CI can handle reliably. :::tip Learn how speculative checks work conceptually at the \[Merge Queue Academy\](https://merge-queue.academy/features/speculative-merging/). ::: :::note Parallel checks are not the same as \*\*parallel mode\*\*. Parallel checks are speculative CI that speed up any single ordered queue, in serial or parallel mode alike. \[Parallel mode\](/merge-queue/queue-modes) is a separate choice about whether independent \[scopes\](/merge-queue/scopes) form independent queues. The two are configured separately and work together. ::: ### The Trade-offs: Reliability, Cost, and Velocity (RCV Theorem) A merge queue can only optimize two of three properties at a time: reliability (merges don't break main), cost (CI jobs executed), and velocity (throughput and latency). We call this the \*\*RCV theorem\*\*, analogous to the \[CAP theorem\](https://en.wikipedia.org/wiki/CAP\_theorem) for data stores. The three viable combinations: - \*\*Reliability + Velocity\*\*: enable \*\*\[parallel speculative checks\](#parallel-checks)\*\* to test predicted merge states concurrently. Wasted CI runs occur when a PR ahead in the queue fails. - \*\*Reliability + Cost\*\*: validate pull requests sequentially. No wasted CI, but throughput is capped at one PR per CI run. - \*\*Velocity + Cost\*\*: use \[batch mode\](/merge-queue/batches) to test groups of PRs as a single unit. Fewer CI runs, but hidden failures inside a passing batch can land on main. Parallel checks and batching can be combined for a middle ground across all three dimensions. ### Determining the Right Configuration for Parallel Checks and Batching Weigh these factors when picking \`batch\_size\` and \`max\_parallel\_checks\`: 1. \*\*Merge throughput and queue latency\*\*: target settings that match your historical merges-per-hour and keep PR wait time acceptable. 2. \*\*Peak load\*\*: size for peak developer hours, not averages, so the queue doesn't back up during busy windows. 3. \*\*CI capacity and job duration\*\*: fast CI and abundant runners tolerate higher parallelism; slow CI or constrained runners need a conservative setting, since reruns on failure are expensive. 4. \*\*Change stability\*\*: repositories with frequent flaky or failing PRs should lower batch size and parallelism to limit wasted work. 5. \*\*Team distribution\*\*: globally distributed teams produce a steady PR flow; concentrated teams spike and need headroom for bursts. ### Letting Mergify Tune Batch Size Automatically The factors above help you pick a fixed \`batch\_size\`, but the ideal value shifts with load: small batches are best when the queue is quiet, larger ones when it backs up. Instead of committing to one number, give \`batch\_size\` a range and let Mergify adapt it in real time: \`\`\`yaml queue\_rules: - name: default batch\_size: min: 1 max: 10 \`\`\` Mergify spreads the queued pull requests across the available \[parallel checks\](#parallel-checks), keeping batches at \`min\` while the queue is light and growing them toward \`max\` only when it backs up. See \[Dynamic Batch Sizing\](/merge-queue/batches#dynamic-batch-sizing) for details. ### Performance Configuration Calculator Provide the inputs below and the calculator will suggest a configuration: 1. \*\*CI time in minutes\*\*: average duration of a CI run. 2. \*\*Estimated CI success ratio in %\*\*: how often CI passes (e.g. 95 if 95 out of 100 runs succeed). 3. \*\*Desired PRs to merge per hour\*\*: target throughput. 4. \*\*Desired CI usage in %\*\*: 100% matches a standard queue. Below 100% favors batching to conserve CI; above 100% favors parallel checks for lower latency at higher CI cost. :::note - This calculator optimizes CI usage and throughput but not latency. If you want to further optimize latency, you need to increase the number of parallel checks. - The average latency computing assumes that the number of PR merged per hour enters the queue at the beginning of the hour. - CI time is an important factor in those computing. If you want to optimize latency and throughput, you should make sure your CI time is as low and optimized as possible. ::: ## Optimizing Merge Queue Time with Efficient CI Runs Every minute shaved off CI compounds across every queued PR. Run only the tests required for the change under test. The \[\*\*Two-step CI\*\*\](/merge-queue/two-step) method splits validation into: 1. \*\*Preliminary tests\*\*: fast checks run when a PR is created or updated, gating entry into the queue. 2. \*\*Pre-merge tests\*\*: exhaustive checks run just before merge. This keeps queue-time CI short without sacrificing final-merge confidence. ## Combining Batch Merging and Parallel Checks \[Batch merging\](/merge-queue/batches) tests multiple PRs as a single unit. \[Parallel checks\](#parallel-checks) run several batches concurrently. Together, they maximize CI utilization: if any PR in a batch fails, \[Mergify splits the batch to isolate the culprit, removes it, and continues processing\](/merge-queue/batches#handling-batch-failure-or-timeout). \`\`\`yaml merge\_queue: max\_parallel\_checks: 2 queue\_rules: - name: default batch\_size: 3 \`\`\` With \`batch\_size: 3\` and \`max\_parallel\_checks: 2\`, Mergify runs up to 2 batches of up to 3 PRs each in parallel. Given 7 queued PRs and a 10-minute CI pipeline, the first 6 merge in 10 minutes instead of the hour required for sequential validation. \`\`\`dot class="queue" title="Speculative checks: batch 2 is tested on top of batch 1 while batch 1 is still validating" digraph { subgraph cluster\_batch2 { class="batch"; label="Batch 2"; subgraph cluster\_batch1 { class="batch"; label="Batch 1"; PR1 \[class="queued"\]; PR2 \[class="queued"\]; PR3 \[class="queued"\]; PR1 -> PR2 -> PR3; } PR4 \[class="queued"\]; PR5 \[class="queued"\]; PR6 \[class="queued"\]; PR3 -> PR4 -> PR5 -> PR6; } PR7 \[class="queued"\]; PR8 \[label="…", class="queued"\]; PR6 -> PR7 -> PR8; CI \[label="Continuous\\nintegration", class="external"\]; PR3 -> CI \[class="muted", style=dashed, dir=both, arrowhead=none, arrowtail=normal\]; PR6 -> CI \[class="muted", style=dashed, dir=both, arrowhead=none, arrowtail=normal\]; } \`\`\` --- # Unknown \--- title: Using Priorities description: Learn how to order your pull requests in the queue by priority. --- Priority rules give you finer control over how your pull requests are ordered within a queue. By applying these rules, you can assign priorities to pull requests based on the conditions you define. This makes it possible to influence the position in which a pull request is added to the queue, so urgent tasks merge sooner. ## Understanding Priority Rules Priority rules in Mergify are a set of guidelines that determine the order of pull requests within a merge queue. They apply a priority (a keyword such as \`low\`, \`medium\`, or \`high\`, or a numerical value) to a pull request based on conditions you've defined. When using a numerical value, it can be between 1 and 10,000. When a pull request is added to a queue, each priority rule is evaluated against its conditions. This assessment determines where the pull request will be placed in the queue. If multiple rules match the pull request, the first matching one will be used. :::note If no priority rule matches, Mergify assigns the \`medium\` priority to a pull request. This is not configurable. ::: Here is a glimpse into the structure of a priority rule: \`\`\`yaml priority\_rules: - name: high priority conditions: - label = urgent priority: high - name: low priority conditions: - label = refactor priority: low \`\`\` In the above configuration: - Two priority rules, \`high priority\` and \`low priority\`, are defined. - Each rule contains conditions (\`label = urgent\` and \`label = refactor\`, respectively) which, if met, apply a certain priority to the pull request (\`high\` or \`low\`). Pull requests that match no priority rules get assigned to \`medium\` priority. - The name under each rule is just an identifier and doesn't impact the functioning of the rule. You can set up to 50 priority rules, tailored to your specific workflow, whether that's prioritizing bug fixes or pushing feature updates to the back. ## How to Define Priority Rules Defining priority rules is straightforward and involves the following steps: 1. \*\*Define priority levels\*\*: Decide on the levels of priority you want to establish for your pull requests. You can use either keywords (\`low\`, \`medium\`, \`high\`) or numerical values for this purpose. 2. \*\*Set up conditions\*\*: Define the conditions under which a pull request should be assigned a particular priority level. These conditions can be based on any \[pull request attribute\](/configuration/conditions#attributes-list). Reference: | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`allow\_checks\_interruption\` | boolean | \`false\` | Allow interrupting the ongoing checks when the pull request entering the queue has a higher priority than the queued one(s). If set to false, a pull request with higher priority will be inserted just after the pull requests that have checks running. | | \`conditions\` | List of conditions | | The list of conditions that needs to match to assign priority to the pull request. | | \`name\` | string | | Name of the rule. | | \`priority\` | \[Priority\](/configuration/data-types#priority) | \`"medium"\` | The priority of the pull request. | The textual priorities have the following numerical values: | Keyword | Numerical Value | | --- | --- | | `low` | 1000 | | `medium` | 2000 | | `high` | 3000 | :::note Remember that a pull request can match multiple rules. In such cases, Mergify picks the first matching rule, in the order they are defined in your config. ::: :::note Priority is always the first criterion when selecting pull requests for batching. Mergify picks PRs strictly in priority order and only after that may look ahead to find additional PRs with the same queue rule to complete the batch. This ensures that higher-priority pull requests are never delayed, while still allowing the system to optimize CI usage and reduce merge time. ::: ## Managing Check Interruptions Based on Priority The \`allow\_checks\_interruption\` option controls what happens to running checks when a higher-priority pull request enters the queue. By default (\`false\`), Mergify does not interrupt ongoing checks: the higher-priority pull request is inserted just after the pull requests whose checks are running, preserving the CI time already spent. Set it to \`true\` to let Mergify interrupt those checks and test the higher-priority pull request first, at the cost of the CI time already spent on the interrupted pull requests. For example: \`\`\`yaml queue\_rules: - name: default merge\_conditions: - "#approved-reviews-by >= 2" - check-success = TeamCity priority\_rules: - name: urgent conditions: - label = urgent priority: high allow\_checks\_interruption: true - name: normal conditions: - label = normal priority: low \`\`\` Here, a pull request labeled \`urgent\` entering the queue interrupts the checks running on a \`normal\` pull request and gets tested first. ## Advanced Priority Rule Usage Beyond the basic use of priority rules, you can use advanced features to fine-tune how your pull requests are prioritized in the queue. ### Using Numerical Values While the keywords (\`low\`, \`medium\`, \`high\`) provide an easy way to define priority, they might be restrictive in some cases. If you need more granular control, consider using numerical values for priority. The higher the number, the higher the priority. For example: \`\`\`yaml priority\_rules: - name: extremely urgent conditions: - label = critical priority: 5000 \`\`\` In this rule, pull requests labeled \`critical\` are given a very high priority. ### Mixing Keywords and Numerical Values There is no rule that prevents you from mixing keyword and numerical values in your priority definitions. This could be useful in scenarios where you want to distinguish between a general set of important tasks (assigned a keyword like \`high\`) and extremely important tasks (assigned a high numerical value). \`\`\`yaml priority\_rules: - name: important task conditions: - label = important priority: high - name: critical task conditions: - label = critical priority: 5000 \`\`\` In this configuration, \`critical\` tasks are treated with the utmost urgency, while \`important\` tasks also receive high priority but are placed after \`critical\` tasks in the queue. ### Complex Condition Definitions The conditions for priority rules are not limited to simple label checks. You can make use of any condition syntax available in Mergify. This includes checks for review status, authorship, file paths, and more. This opens up a wide array of possibilities for defining intricate priority systems based on your team's workflow. Here's an example that gives high priority to pull requests that modify the \`/src\` directory: \`\`\`yaml priority\_rules: - name: core changes conditions: - files ~= ^src/ priority: high \`\`\` These are just a few ways to get the most out of Mergify's priority rules. By thinking about your team's needs and workflow, you can use these advanced usage scenarios to create a priority system that best serves your project. ## Troubleshooting Priority Rules Even with the best planning and understanding, you may run into issues when setting up or managing priority rules. Here are some common problems and their solutions: ### Priority Rule Not Applied If you find that a priority rule is not applied as expected, there may be several reasons: - Check the conditions of the priority rule. Ensure that the pull request matches the conditions specified in the priority rule. - There might be an error in the syntax or formatting of your Mergify configuration file. Be sure to verify the syntax and structure of your configuration file. ### Unexpected Queue Position If a pull request ends up in an unexpected position in the queue: - Verify the priority assigned in the priority rule. A higher value or a higher priority keyword (e.g., "high") will place the pull request closer to the front of the queue. - Make sure there isn't another priority rule that is placing the pull request at a different position. --- # Unknown \--- title: Monorepo description: Optimize merge queue batching for monorepos with scopes. --- In monorepo environments, not every pull request affects the entire codebase. Running the full validation matrix for each change quickly becomes wasteful, yet batching unrelated pull requests still makes the queue churn through work that doesn't matter. This page shows how Mergify's monorepo capabilities keep batching efficient without sacrificing safety. :::tip Learn about merge queue strategies for monorepos at the \[Merge Queue Academy\](https://merge-queue.academy/use-cases/monorepos/). ::: To solve this, Mergify introduces \*\*scopes\*\*, named regions of your repository that describe which services, packages, or domains a change touches. The rest of this guide shows how scopes pair with monorepo-aware tooling to batch compatible pull requests, keep unrelated work apart, and drive only the CI jobs that matter. For the full schema and advanced strategies, see \[Merge Queue Scopes\](/merge-queue/scopes). ## The Batching Challenge in Monorepos Without scopes, Mergify batches pull requests together regardless of what they change. This means: - A Python service change and a JavaScript frontend change might be batched together - Both sets of tests run even though they're completely independent - If one fails, both PRs are affected by the batch split process With scopes, Mergify can: - Batch together PRs that affect the same scopes (e.g., multiple Python changes) - Keep independent changes in separate batches - Reduce unnecessary CI runs for unrelated parts of your codebase ## Monorepo support at a glance 1. \*\*Define scopes\*\* in \`.mergify.yml\` using either file patterns or data emitted by your build system. Start with the \[Scopes reference\](/merge-queue/scopes). 2. \*\*Batch by scope in Merge Queue\*\* to group compatible pull requests and keep unrelated work apart. With file patterns, Mergify evaluates them itself, so the queue batches by scope with no extra setup. 3. \*\*Optionally, collect scopes in CI\*\* via \[\`gha-mergify-ci\`\](https://github.com/Mergifyio/gha-mergify-ci) when you compute scopes with a build system (Nx, Bazel, Turborepo, Pants) or want to gate expensive tests on the scopes a pull request touches. 4. \*\*Get \[Direct Merge\](/merge-queue/direct-merge)\*\* once a pull request carries scopes, whichever way they were attached: when the base branch has moved only in scopes that pull request does not touch, it merges immediately with no queue CI run. Other conditions apply, listed on that page. Need scope-aware CI without the merge queue? The \[GitHub Actions\](/integrations/gha#job-selection) and \[Buildkite\](/integrations/buildkite#job-selection) integrations show how to skip unaffected CI jobs with the same scopes. ### No monorepo tooling yet? Just declare file-pattern scopes in \`.mergify.yml\`. Mergify evaluates them and the merge queue batches by scope with no workflow to add, so you get scope-aware batching without introducing Nx, Bazel, or Turborepo first. When you also want scope-aware CI, the \[GitHub Actions integration\](/integrations/gha#job-selection) ships a ready-made \[\`gha-mergify-ci\`\](https://github.com/Mergifyio/gha-mergify-ci) workflow. As your repository grows you can swap in more advanced tooling, and your scopes stay the same. ## Understanding Scopes Scopes define discrete areas of your monorepo (like packages, services, or components). When a pull request is created, Mergify automatically determines which scopes are affected and uses this information to optimize batching. The \[Scopes reference\](/merge-queue/scopes) covers the schema plus all tooling-specific guides, including file-pattern detection and integrations with Bazel, Nx, and Turborepo. If you already run Nx, Bazel, Turborepo, or another orchestrator, point it at \`gha-mergify-ci\` to upload those scope names: \*\*scopes are the feature Merge Queue consumes\*\*, regardless of how you compute them. ## Next steps - \[Scopes reference\](/merge-queue/scopes): schema, file-pattern setup, and tooling guides (Nx, Bazel, Turborepo, Pants, custom uploaders). - \[Queue Modes\](/merge-queue/queue-modes): once scopes are configured, enable parallel mode to test and merge pull requests that touch different scopes simultaneously, reducing merge times in monorepos. - \[GitHub Actions\](/integrations/gha#job-selection) and \[Buildkite\](/integrations/buildkite#job-selection) integrations: reuse the same scopes to skip unaffected CI jobs on pull requests. --- # Unknown \--- title: Queue Modes description: "Choose how the merge queue schedules pull requests: serial, parallel, or isolated." --- The \`merge\_queue.mode\` option controls how the merge queue schedules pull requests. There are three modes: - \*\*\`serial\`\*\* (default): every pull request is tested on top of the previous one, in a single ordered pipeline. - \*\*\`parallel\`\*\*: pull requests that touch different \[scopes\](/merge-queue/scopes) are tested and merged at the same time. - \*\*\`isolated\`\*\*: every batch runs as a fully independent unit, with no dependency on any other batch. All three honor your \[queue rules\](/merge-queue/rules) and \[batch sizing\](/merge-queue/batches), and in all three \[Direct Merge\](/merge-queue/direct-merge) can skip a pull request's CI run entirely when the base branch has not moved underneath it, either not at all or only in scopes it does not touch. They differ only in \*\*how batches depend on each other\*\*. ## Choosing a mode | Mode | Batches depend on each other? | PRs tested against each other? | Requires scopes? | Best for | |------|-------------------------------|-------------------------------|------------------|----------| | \`serial\` | Yes, builds on the previous batch | Yes, every PR cumulatively | No | Repos where PRs touch the same code | | \`parallel\` | Only when scopes overlap | Only PRs sharing a scope | Yes | Monorepos where PRs touch independent areas | | \`isolated\` | Never | No, only against the base branch | No | Independent PRs, max throughput, accept conflict risk | The rest of this page describes each mode in turn. Serial is the default, so if you do nothing you are already using it. ## Serial Mode Serial mode is the \*\*default\*\*: you don't need to configure anything to use it. Every pull request is tested on top of the one before it, forming a single ordered pipeline. This guarantees correctness: each pull request is validated against the exact state it will merge into. The trade-off is that unrelated changes still wait for each other. \`\`\`dot class="queue" title="Serial mode — one queue: batch 1 is being tested, batches 2 and 3 wait behind it" digraph { PR1 \[label="Batch 1\\nPR #1 (api)", class="pending"\]; PR2 \[label="Batch 2\\nPR #2 (frontend)", class="queued"\]; PR3 \[label="Batch 3\\nPR #3 (docs)", class="queued"\]; PR1 -> PR2 -> PR3; } \`\`\` Even though PR #3 (docs) has nothing in common with PR #1 (api) or PR #2 (frontend), it still waits behind them. You can set it explicitly, though it is the default: \`\`\`yaml merge\_queue: mode: serial \`\`\` Serial mode still uses \[batches\](/merge-queue/batches) and \[parallel checks\](/merge-queue/performance#parallel-checks) to increase throughput without giving up cumulative testing. If most of your pull requests touch the same files, serial mode is usually the right choice. ## Parallel Mode Parallel mode tests and merges pull requests that touch different areas of the codebase (different \[scopes\](/merge-queue/scopes)) at the same time. Pull requests that share a scope are still queued together so they are tested as a group, preventing semantic conflicts. :::tip Parallel mode is designed for monorepos and large repositories where pull requests frequently change independent parts of the codebase. If most of your pull requests touch the same files, serial mode may be a better fit. ::: :::note Parallel \*\*mode\*\* is not the same as \[parallel checks\](/merge-queue/performance#parallel-checks). Parallel mode is about \*\*scopes\*\*: independent queues that don't wait on each other. Parallel checks are \*\*speculative\*\* CI that test queued pull requests ahead of time within a single ordered queue, and they run in serial mode too. The two are configured separately and work together. ::: Batches that share no scope run at the same time: \`\`\`dot class="flow" title="Parallel mode — batches with no scope in common are tested at the same time" digraph { edge \[style=invis\]; subgraph cluster\_running { class="batch"; label="Tested simultaneously"; PR1 \[label="Batch 1\\nPR #1 (api)", class="pending"\]; PR2 \[label="Batch 2\\nPR #2 (frontend)", class="pending"\]; PR3 \[label="Batch 3\\nPR #3 (docs)", class="pending"\]; { rank=same; PR1; PR2; PR3; } } } \`\`\` When scopes \*\*do\*\* overlap, Mergify preserves ordering within that scope to guarantee the changes are tested together: \`\`\`dot class="queue" title="Parallel mode — batch 2 shares the api scope with batch 1, so it waits; batch 3 proceeds on its own" digraph { PR1 \[label="Batch 1\\nPR #1 (api)", class="pending"\]; PR4 \[label="Batch 2\\nPR #4 (api, frontend)", class="queued"\]; PR3 \[label="Batch 3\\nPR #3 (docs)", class="pending"\]; PR1 -> PR4 \[label="same scope: api"\]; { rank=same; PR1; PR3; } } \`\`\` Here PR #4 touches the \`api\` scope, just like PR #1, so it must wait for PR #1 to merge first. Meanwhile PR #3 (docs) proceeds independently. ### Set up parallel mode Parallel mode requires two things: configuring \[scopes\](/merge-queue/scopes) so Mergify knows which areas of the codebase each pull request touches, and switching the mode. #### 1. Define scopes Scopes can come from file patterns declared directly in \`.mergify.yml\`, or from an external build system (Nx, Bazel, Turborepo, …) via the \[\`gha-mergify-ci\`\](https://github.com/Mergifyio/gha-mergify-ci) GitHub Action. \`\`\`yaml scopes: source: files: api: include: - services/api/\*\*/\* frontend: include: - apps/web/\*\*/\* docs: include: - docs/\*\*/\* \`\`\` See \[Scopes\](/merge-queue/scopes) for all configuration options and build-tool integrations. #### 2. Enable parallel mode Add \`mode: parallel\` under \`merge\_queue\`: \`\`\`yaml merge\_queue: mode: parallel max\_parallel\_checks: 5 scopes: source: files: api: include: - services/api/\*\*/\* frontend: include: - apps/web/\*\*/\* docs: include: - docs/\*\*/\* queue\_rules: - name: default batch\_size: 3 queue\_conditions: - check-success = ci \`\`\` The \`max\_parallel\_checks\` setting controls how many batches Mergify tests at the same time across all scope queues. Tune it to match your CI capacity. ### How parallel mode works Once parallel mode is active, the merge queue follows these steps whenever it processes pull requests: 1. \*\*Scope assignment.\*\* Each pull request is tagged with the scopes it affects, either automatically from file patterns or via an external upload. 2. \*\*Batch formation.\*\* Mergify groups pull requests that share \*\*exactly the same set of scopes\*\* into batches (respecting \`batch\_size\`). Pull requests with different scopes form separate batches. 3. \*\*Dependency tracking.\*\* Batches that share at least one scope are linked as parent → child in a dependency graph. A child batch cannot merge until all its parents have merged. 4. \*\*Parallel execution.\*\* Batches with no shared scopes (and therefore no dependency) are tested by CI at the same time, up to \`max\_parallel\_checks\`. 5. \*\*Merge.\*\* As soon as a batch's CI passes and all its parent batches are merged, Mergify merges the pull requests in that batch. When a batch fails, Mergify splits it and retests the parts to isolate the problematic pull request (see \[Handling Batch Failures\](/merge-queue/batches#handling-batch-failure-or-timeout)). Because batches are scoped, a failure in one scope queue does \*\*not\*\* block unrelated scope queues: only batches that depend on the failed one (via a shared scope) are affected. ### Limiting concurrency per scope \`max\_parallel\_checks\` caps how many speculative checks run at once across \*\*all\*\* scopes. Sometimes you want to bound a \*\*single\*\* scope on top of that: a scope whose tests are expensive or hit a shared resource that can't take many concurrent runs (a staging environment or a rate-limited external service), while the rest of your scopes can use whatever capacity the global ceiling leaves them. \`scopes.capacities\` maps a scope name to the number of speculative checks that scope may run at the same time: \`\`\`yaml merge\_queue: mode: parallel max\_parallel\_checks: 5 scopes: source: files: frontend: include: - apps/web/\*\*/\* backend: include: - services/api/\*\*/\* docs: include: - docs/\*\*/\* capacities: frontend: 2 backend: 2 \`\`\` Here \`frontend\` and \`backend\` are each limited to 2 concurrent speculative checks. \`docs\` is absent from the map, so it stays uncapped: only the global ceiling applies to it. #### Naming scopes with patterns A key holding \`\*\`, \`?\`, \`\[\` or \`{\` is a glob over scope names rather than one name, with the syntax of \[\`files\` filters\](/configuration/data-types#globs): \`\*\` and \`?\` stay inside one \`/\`-separated segment, and only a whole \`\*\*\` segment crosses them. So \`//lib/\*\*\` matches the packages below \`//lib\` but not \`//lib\` itself. A pattern gives \*\*every scope it matches its own budget\*\*, not one budget the matches share. \`\`\`yaml scopes: source: manual: capacities: '@acme/\*': 2 '@acme/payments': 1 \`\`\` Quote any key starting with \`@\`, \`\*\`, \`?\`, \`\[\` or \`{\`: YAML does not read those as plain scalars. A key naming a scope exactly wins over any pattern, so \`@acme/payments\` is held to one check while its siblings get two. When several patterns match a scope and no key names it, the smallest capacity applies, so the result never depends on key order, which a YAML mapping does not define anyway. What an exact key may say depends on \[\`scopes.source\`\](/merge-queue/scopes). With a \`manual\` source it can be any name the scopes API accepts, including a Bazel label like \`//lib/core\` or a scoped package name like \`@acme/web\`. Under any other source it must be a scope name the \`files\` source could declare: at least two characters, matching \`^\[A-Za-z0-9\_-\]+$\`. A key outside that is rejected rather than ignored, since it would cap a scope that can never exist. #### How capacities relate to the global ceiling \`max\_parallel\_checks\` is the \*\*global ceiling\*\*: the most speculative checks a queue will ever run at once. Each \`scopes.capacities\` entry is a \*\*sub-limit inside that ceiling, not an extra budget on top of it\*\*: - A speculative check consumes one global slot \*\*and\*\* one slot in every capped scope its batch belongs to. - It starts only when the global ceiling has room \*\*and\*\* each of its capped scopes has room. - A scope that no \`capacities\` key matches is unlimited; it draws on the global ceiling alone. \[\`default\_capacity\`\](#capping-scopes-you-did-not-list) changes that. Because every check always takes a global slot, the total running at once \*\*never exceeds \`max\_parallel\_checks\`\*\*, whatever you put in \`capacities\`. Capacities can only ever hold a scope below the global ceiling; they never raise the total, so adding them to an existing configuration cannot increase your CI load. #### Worked example Take the configuration above (\`max\_parallel\_checks: 5\`, \`frontend: 2\`, \`backend: 2\`, \`docs\` uncapped) and suppose the queue is ready to test three \`frontend\` batches, three \`backend\` batches, and two \`docs\` batches. The slots might fill like this: \`\`\`dot class="flow" title="Per-scope capacity — ceiling 5, frontend 2, backend 2, docs uncapped" digraph { edge \[style=invis\]; subgraph cluster\_running { class="batch"; label="Running now — 5 of 5 slots used"; F1 \[label="frontend #1", class="pending"\]; F2 \[label="frontend #2", class="pending"\]; B1 \[label="backend #1", class="pending"\]; B2 \[label="backend #2", class="pending"\]; D1 \[label="docs #1", class="pending"\]; { rank=same; F1; F2; B1; B2; D1; } } subgraph cluster\_waiting { class="batch"; label="Waiting"; F3 \[label="frontend #3\\nfrontend full", class="queued"\]; B3 \[label="backend #3\\nbackend full", class="queued"\]; D2 \[label="docs #2\\nceiling full", class="queued"\]; { rank=same; F3; B3; D2; } } } \`\`\` - \`frontend\` and \`backend\` each run at most 2 batches, so each holds back its third; those wait for a free slot in their own scope. - \`docs\` is uncapped, but only as many \`docs\` batches run as there is room under the ceiling of 5. Here that is 1, so the second \`docs\` batch waits, not because \`docs\` is capped (it isn't) but because the global ceiling is full. Two things always hold: no capped scope runs more than its limit, and no more than \`max\_parallel\_checks\` run at once. Exactly which batches fill the slots, and whether the last free slot goes to \`docs\` or to a capped scope still below its limit, follows queue order, so the split can differ from one cycle to the next. As soon as a running check finishes, its freed global slot (and its freed scope slot, if any) go to the next waiting batch that fits both. #### Capping scopes you did not list \`scopes.default\_capacity\` sets the limit for every scope no \`capacities\` key matches. Naming each scope works when you have a handful of them, but not when they come from a build system: an \[Nx\](/merge-queue/scopes/nx) or \[Bazel\](/merge-queue/scopes/bazel) graph names hundreds of projects, and the set changes with every pull request that adds one. \`\`\`yaml merge\_queue: mode: parallel max\_parallel\_checks: 10 scopes: source: manual: capacities: e2e: 1 default\_capacity: 3 \`\`\` Here \`e2e\` is held to one speculative check at a time, and every other scope a queued pull request carries gets three. Any matching \`capacities\` key wins for its scope, so you only name the scopes that need something other than the default. The default applies to the scopes Mergify sees on the pull requests currently queued, which is what lets it cover names you never wrote down. Pull requests carrying no scope at all are unaffected: they draw on the global ceiling alone, as they do without any capacity configured. And \`max\_parallel\_checks\` still caps the total: like \`capacities\`, a default capacity only ever holds scopes below the global ceiling, it never raises the number of checks running at once. Like \`capacities\`, this option needs \`parallel\` or \`isolated\` mode. Setting it on a \`serial\` queue is rejected rather than ignored: serial mode tests everything in one cumulative pipeline, so there are no independent per-scope lanes for a sub-limit to bind on. #### Pull requests in several scopes A batch that touches more than one capped scope must fit in \*\*all\*\* of them at once. A batch carrying both \`frontend\` and \`backend\` consumes one \`frontend\` slot and one \`backend\` slot, and starts only when both scopes, and the global ceiling, have room. This keeps every scope's limit honored even when changes span scopes. The extreme case is a pull request \[flagged with \`all\_scopes\`\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope): it consumes one slot in every capped scope. In parallel mode it is also a barrier, queued behind every batch in flight and holding back everything queued after it, so nothing runs alongside it. Isolated mode builds no dependencies between batches, so the flag has no effect on ordering: an \`all\_scopes\` pull request consumes one slot in every capped scope and nothing more. #### Source-agnostic \`capacities\` only sets the limit; it does not decide which pull requests belong to a scope. Membership comes from your \[\`scopes.source\`\](/merge-queue/scopes), so capacities behave the same whether scopes are derived from \[file patterns\](/merge-queue/scopes/file-patterns) (\`source: files\`) or pushed from an external build system (\`source: manual\`). You declare the limit once, no matter how membership is computed. :::note Strict branch protection (\*Require branches to be up to date before merging\*) clamps the whole queue to one check at a time, so each scope's effective capacity becomes 1 and \`capacities\` has no further effect. See \[Require Branches to Be Up to Date\](/merge-queue/github-rulesets#require-branches-to-be-up-to-date). ::: ### The monorepo trade-off Parallel mode is built for the reality of monorepos: most pull requests are independent, but some do interact. | Scenario | What happens | Benefit | |----------|-------------|---------| | PRs touch \*\*different\*\* scopes | Tested and merged in parallel | Faster merge times, no waiting for unrelated work | | PRs touch \*\*the same\*\* scope | Ordered within that scope queue and tested together | Conflicts caught before merge | | A PR touches \*\*multiple\*\* scopes | Linked to all relevant scope queues | Correctness preserved across scopes | The net effect: \*\*pull requests merge faster when their scopes don't collide\*\*, while pull requests that do collide are still tested in the right order to avoid semantic conflicts reaching your base branch. ## Isolated Mode Parallel mode keeps dependencies between batches that share a scope. \*\*Isolated mode\*\* drops them entirely: every batch is a self-contained unit that is tested and merged on its own, with no parent batch and no child batch. A failure in one batch never blocks any other. \`\`\`dot class="flow" title="Isolated mode — every batch is tested on its own, with no dependency on any other" digraph { edge \[style=invis\]; subgraph cluster\_running { class="batch"; label="Tested simultaneously"; PR1 \[label="Batch 1\\nPR #1", class="pending"\]; PR2 \[label="Batch 2\\nPR #2", class="pending"\]; PR3 \[label="Batch 3\\nPR #3", class="pending"\]; { rank=same; PR1; PR2; PR3; } } } \`\`\` Use isolated mode when your pull requests are genuinely independent and you want maximum throughput without maintaining a scope map, for example when each pull request targets its own service or package and you don't need Mergify to serialize overlapping changes. :::caution Isolated mode never tests pull requests against each other. Two pull requests that pass on their own but conflict semantically can both merge and break your base branch. Parallel mode protects against this by serializing pull requests that share a scope; isolated mode drops that safety net. Use it only when your pull requests are truly independent. ::: ### Enable isolated mode Set \`mode: isolated\` under \`merge\_queue\`. Unlike parallel mode, scopes are \*\*optional\*\*: \`\`\`yaml merge\_queue: mode: isolated max\_parallel\_checks: 5 queue\_rules: - name: default batch\_size: 5 queue\_conditions: - check-success = ci \`\`\` :::caution Isolated mode requires speculative checks to be useful: \`max\_parallel\_checks\` must be greater than 1. With \`max\_parallel\_checks: 1\` (speculative checks disabled), batches still run one at a time. You get no throughput gain and lose serial mode's cumulative testing. If you can't run speculative checks, use \`serial\` instead. ::: ### How isolated batches form How Mergify fills a batch depends on whether you configure \[scopes\](/merge-queue/scopes): - \*\*With scopes.\*\* Mergify groups the most similar pull requests (those sharing the most scopes) into the same batch, using the same \[scope-aware batching\](/merge-queue/scopes) as the other modes. This keeps related changes tested together and maximizes CI reuse. - \*\*Without scopes.\*\* Mergify seeds each batch by queue priority and arrival order, then fills the remaining slots with the pull requests that change similar directories, as described in \[How Pull Requests Are Grouped Into a Batch\](/merge-queue/batches#how-pull-requests-are-grouped-into-a-batch). Either way, the resulting batches are fully independent. They run concurrently up to \`max\_parallel\_checks\`, and Mergify merges each one as soon as its own CI passes; there is never a parent batch to wait for. Batch failures are handled the same way as in the other modes (see \[Handling Batch Failures\](/merge-queue/batches#handling-batch-failure-or-timeout)). ## Compatibility and Limitations Parallel and isolated modes change how the queue operates, so some features behave differently or aren't available depending on the mode: - \*\*Scopes are required in parallel mode.\*\* You must configure \`scopes.source\` (either \`files\` or \`manual\`) so Mergify can tell which pull requests are independent. Serial and isolated modes do not require scopes. - \*\*\`fast-forward\` merge is not supported.\*\* Because batches merge independently, Mergify needs to rebase them. Mergify rejects a configuration that combines the two. Every other \`merge\_method\` works: \`merge\`, \`squash\`, \`rebase\`, and \`merge-batch\`. - \*\*\`skip\_intermediate\_results\` is not supported in isolated mode.\*\* Isolated batches are fully independent, so a passing batch can't vouch for any other. It works in serial and parallel modes, where a passing batch vouches for the earlier changes it was tested on top of. - \*\*A barrier does not serialize an isolated queue.\*\* In parallel mode, a pull request flagged with \[\`all\_scopes\`\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope) waits for every batch in flight and holds back everything queued after it. Isolated mode builds no dependencies between batches, so the flag has no effect on ordering there; the pull request still counts against any \[per-scope capacity\](#limiting-concurrency-per-scope) you set. Independently of the mode, \`partition\_rules\` are no longer part of the configuration: use scopes instead. See \[Migrate from Partition Rules to Scopes\](/merge-queue/migrate-partitions-to-scopes). ## Next Steps - \[Scopes\](/merge-queue/scopes): learn how to define and manage scopes for your repository. - \[Batches\](/merge-queue/batches): understand batch formation, sizing, and failure handling. - \[Performance\](/merge-queue/performance): tune your queue for the right balance of speed, cost, and reliability. - \[Monorepo\](/merge-queue/monorepo): broader guidance on using Mergify in monorepo setups. --- # Unknown \--- title: Scopes with Other Build Tools description: Configure merge queue scopes using your preferred monorepo tooling. --- If you're using monorepo tools that have built-in dependency graph analysis, you can use their affected project detection instead of file patterns. This approach is often more accurate because these tools understand your project's dependency relationships. ## Configuring Manual Scopes To use the manual scopes mechanism, configure Mergify to expect scopes from your CI system: \`\`\`yaml scopes: source: manual: queue\_rules: - name: default batch\_size: 5 \`\`\` ## Detecting Scopes with Your Build Tool Use your monorepo tool to determine affected projects and upload them to Mergify. \### GitHub Actions \`\`\`yaml name: Detect Scopes on: pull\_request: jobs: detect-scopes: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 with: # The queue-aware base commit must exist locally: monorepo tools # resolve the base/head range through git. fetch-depth: 0 - name: Get git refs id: refs uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-git-refs - name: Get scopes id: scopes env: HEAD: ${{ steps.refs.outputs.head }} BASE: ${{ steps.refs.outputs.base }} run: | # scopes-git-refs reports an empty base on any event that is neither # a pull request nor a push. Diffing against an empty revision, or # letting the build tool fall back to its own default base, reports # scopes for the wrong range. \[ -n "$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # A failed command piped into paste still exits 0 and writes an # empty scope list, which the queue reads as "this pull request # affects nothing", so capture the projects first. projects=$(my\_monorepo\_command\_to\_get\_impacted\_projects "$BASE" "$HEAD") || exit 1 scopes=$(printf '%s\\n' "$projects" | paste -sd, -) echo "scopes=$scopes" >> "$GITHUB\_OUTPUT" - name: Scopes upload uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-upload token: ${{ secrets.MERGIFY\_TOKEN }} scopes: ${{ steps.scopes.outputs.scopes }} \`\`\` ### Buildkite Using the \[\`mergifyio/mergify-ci\`\](https://github.com/Mergifyio/mergify-ci-buildkite-plugin) Buildkite plugin, a first step resolves the merge-queue-aware base and head SHAs and exposes them as meta-data, a second computes the affected projects with your monorepo tool into the \`mergify-ci.scopes\` meta-data, and a third uploads them. The upload runs in its own step because the plugin replaces the step's command, so a step that both detects and uploads never runs its detection: \`\`\`yaml steps: - label: ":mag: Get git refs" key: git-refs plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-git-refs - label: ":mag: Detect scopes" key: detect-scopes depends\_on: git-refs command: | # The base meta-data is only published when a base was resolved, so a # missing key means there is no base to diff against. Check the value # too: an empty one would send the build tool back to its own default # base and report scopes for the wrong range. BASE=$(buildkite-agent meta-data get "mergify-ci.base") || exit 1 HEAD=$(buildkite-agent meta-data get "mergify-ci.head") || exit 1 \[ -n "$$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # A failed command piped into paste still exits 0 and writes an empty # scope list, which the queue reads as "this pull request affects # nothing", so capture the projects first. PROJECTS=$(my\_monorepo\_command\_to\_get\_impacted\_projects "$$BASE" "$$HEAD") || exit 1 SCOPES=$(printf '%s\\n' "$$PROJECTS" | paste -sd, -) buildkite-agent meta-data set "mergify-ci.scopes" "$$SCOPES" - label: ":mag: Upload scopes" depends\_on: detect-scopes plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-upload \`\`\` The plugin reads your \[application key\](/api/usage) from \`MERGIFY\_TOKEN\` in the agent's environment. Without it the step still runs, but it logs a warning and sends nothing, and the build stays green, so a missing token looks like a pipeline that reports no scopes. \### Any CI (Mergify CLI) 0))}' > scopes.json\`} /> --- # Unknown \--- title: Scopes with File Patterns description: Configure merge queue scopes using file patterns to batch pull requests intelligently. --- Mergify allows you to define scopes using file patterns to intelligently batch pull requests based on which parts of your monorepo they modify. This approach is simple to set up and works well when your monorepo structure follows clear directory boundaries. ## Defining File Patterns Define scopes in your \`.mergify.yml\` configuration file using file patterns: \`\`\`yaml scopes: source: files: python-api: include: - api/\*\*/\*.py - libs/shared/\*\*/\*.py frontend: include: - web/\*\*/\*.js - web/\*\*/\*.jsx - web/\*\*/\*.ts - web/\*\*/\*.tsx docs: include: - docs/\*\*/\*.md - docs/\*\*/\*.mdx queue\_rules: - name: default batch\_size: 5 \`\`\` In this example: - Changes to Python files in \`api/\` or \`libs/shared/\` get the \`python-api\` scope - Changes to frontend files in \`web/\` get the \`frontend\` scope - Documentation changes get the \`docs\` scope :::tip When filling a batch, Mergify picks the queued pull request whose scopes are closest to the batch's, meaning the largest share in common out of every scope either side names, so changes to the same area of the repository tend to travel together. In \[parallel mode\](/merge-queue/queue-modes) the grouping is stricter: pull requests are grouped by their exact set of scopes, so a pull request scoped to \`python-api\` alone and one scoped to both \`python-api\` and \`frontend\` go into different batches. ::: ## Pattern Syntax \`include\` and \`exclude\` accept the same \[glob patterns\](/configuration/data-types#globs) as the \`\*=\` operator in conditions. That includes \[brace alternation\](/configuration/data-types#brace-alternation), which collapses a list of extensions into one pattern. The \`frontend\` scope above can also be written as: \`\`\`yaml scopes: source: files: frontend: include: - web/\*\*/\*.{js,jsx,ts,tsx} \`\`\` Mergify validates every pattern when it loads your configuration. An unbalanced \`{\` is a configuration error, not a scope that silently matches nothing. ## How Mergify Evaluates File-Pattern Scopes Mergify evaluates file-pattern scopes itself. For each pull request, it matches the changed files against your \`include\` (and optional \`exclude\`) patterns and tags the pull request with the scopes it touches. This happens in the merge queue automatically, with no CI job or GitHub Action to set up: declare the patterns above and the queue batches by scope. ## Conditioning CI Jobs on Scopes (Optional) The same scopes can also drive your CI, letting you skip jobs whose scope a pull request doesn't touch. This is optional and independent of merge queue batching. To wire it up, follow the Job Selection section of the \[GitHub Actions integration\](/integrations/gha#job-selection). It walks through: - Adding the \[\`gha-mergify-ci\`\](https://github.com/Mergifyio/gha-mergify-ci) workflow step that reads your file-pattern scopes and exposes them as outputs. - Conditioning downstream jobs (frontend, backend, docs, etc.) on those scope outputs. - Waiting on the right set of jobs so required checks always report, even when work is skipped. That section already includes complete workflow samples, so you do not need to duplicate the config here. Just reuse the same scopes you declared above. The \[Buildkite integration\](/integrations/buildkite#job-selection) walks through the first two steps for Buildkite pipelines, using a dynamic pipeline instead of job conditions. ## The Merge Queue Scope The \`gha-mergify-ci\` action automatically provides a special \`merge-queue\` scope that returns \`true\` only when running in a merge queue context (on temporary merge queue branches). This is useful for: - \*\*Integration tests\*\* that only need to run before merging - \*\*End-to-end tests\*\* that are expensive and should only run on final batches - \*\*Deployment validation\*\* that needs to happen before code reaches the main branch Gate the job on the scope, the same way you gate any other. \`detect-scopes\` below is the job from the \[GitHub Actions integration\](/integrations/gha#job-selection), with \`merge-queue\` added to its \`outputs\`: \`\`\`yaml integration-tests: if: ${{ needs.detect-scopes.outputs.merge-queue == 'true' }} needs: detect-scopes runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v5 - name: Run expensive integration tests run: npm run test:integration \`\`\` ## Example: Multi-Language Monorepo Here's a real-world example for a monorepo with Python, JavaScript, and Go services: \`\`\`yaml scopes: source: files: python-api: include: - services/api/\*\*/\*.py - libs/python/\*\*/\*.py user-service: include: - services/users/\*\*/\*.go frontend: include: - apps/web/\*\*/\*.js - apps/web/\*\*/\*.jsx - apps/web/\*\*/\*.ts - apps/web/\*\*/\*.tsx shared-config: include: - config/\*\*/\* - docker/\*\*/\* queue\_rules: - name: default batch\_size: 8 batch\_max\_wait\_time: 5 min \`\`\` With this configuration: - PRs affecting only \`frontend\` batch together - PRs affecting \`python-api\` batch together - PRs affecting \`shared-config\` batch with each other A scope name carries no special meaning, so \`shared-config\` does not batch with every other scope just because it happens to hold shared files. To make a change to shared files affect every scope, list those files under \[\`barrier\_files\`\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope) instead. ## Important Behaviors ### Scope Detection is PR-Specific Mergify evaluates the files changed by the specific pull request, \*\*not\*\* files from other PRs in the merge queue batch. This ensures: - Each PR's scopes reflect only its own changes - Batching decisions remain consistent even as the queue changes - Tests run for the correct scopes regardless of what else is in the batch ### Renamed Files Count at Both Paths A rename touches two paths: the file disappears from where it was and appears where it went. Mergify matches your patterns against \*\*both\*\*, so moving a file out of a scope reports that scope just as deleting the file would. With the multi-language scopes above, \`git mv services/api/settings.py config/settings.py\` reports \*\*both\*\* \`python-api\` (the path the file left) and \`shared-config\` (the path it arrived at). That matters when a scope guards something: a pull request that moves a file out of \`services/api/\` is a change to \`services/api/\`, so the \`python-api\` scope's CI jobs and batching rules apply to it. The same rule applies to \`barrier\_files\`: renaming a file out of a barrier pattern makes the pull request a barrier, because the barrier file is gone from its declared location. ### Path Filtering vs Scopes GitHub Actions offers path filtering (\`on.pull\_request.paths\`), but it has critical limitations in merge queue scenarios: \`\`\`yaml # ❌ Don't use path filtering for merge queues on: pull\_request: paths: - 'api/\*\*' \`\`\` \*\*Problems with path filtering:\*\* - When a job doesn't run, you can't distinguish between "filtered out" and "CI failed to start" - Required status checks fail if jobs are skipped due to filtering - In merge queues, you don't want to skip tests on PR2 just because PR1 in the batch modified different files \*\*✅ Use scopes instead:\*\* - Jobs always run but can conditionally skip work based on scope detection - Status checks always report (success or skipped) - Merge queue batching respects scope boundaries --- # Unknown \--- title: Scopes with Bazel description: Compute merge queue scopes from Bazel's dependency graph with bazel-diff so every impacted package is reported. --- Bazel knows the entire dependency graph of your monorepo, which makes it a good source of scopes, as long as the query asks which targets a pull request can break rather than which packages hold the files it touched. \[bazel-diff\](https://github.com/Tinder/bazel-diff) answers that question. It hashes every target in the graph at two revisions (over the target's own content, its rule attributes and its transitive dependencies), then reports the targets whose hash changed. That is the impacted set, and its packages are your scopes. It is also what other CI tooling reaches for on this question: \[Trunk's Bazel action\](https://github.com/trunk-io/bazel-action) computes its impacted targets with bazel-diff, and Aspect's Extension Language wraps the same tool as an \[\`impacted\` command\](https://github.com/aspect-extensions/impacted). Adding a JVM to a scope detection job is a real cost, and this is the part of that job that is not novel. Here's the whole setup running on a Bazel monorepo, from the scope detection step in CI to several packages testing in their own lanes at once: \## Configuring Manual Scopes To use the manual scopes mechanism, configure Mergify to expect scopes from your CI system: \`\`\`yaml scopes: source: manual: queue\_rules: - name: default batch\_size: 5 \`\`\` ## Why the impacted set is not the changed set \[Scopes\](/merge-queue/scopes) are a safety mechanism. Pull requests that share a scope are \[batched\](/merge-queue/batches) and tested together and never merged in parallel, while pull requests with no scope in common run side by side. The same list usually decides which CI jobs a pull request may skip. A scope list that comes up short is therefore not merely imprecise: it lets the queue parallelize pull requests that conflict, and it lets the jobs gated on those scopes skip work the change really did affect. Queries built on changed file paths produce exactly that kind of short list. \`buildfiles()\` returns the \`BUILD\` and \`.bzl\` files needed to \*load\* the packages the changed files live in, which walks the graph away from the dependents instead of towards them. Take a workspace where \`//app/server\` depends on \`//lib/util\`, which depends on \`//lib/core\`, and where every \`BUILD\` file loads a macro from \`//tools\`: | Change | \`buildfiles(set(…))\` returns | Impacted packages | | --- | --- | --- | | a source file in \`lib/core\` | \`lib/core\`, \`tools\` | \`lib/core\`, \`lib/util\`, \`app/server\` | | an attribute in \`lib/util/BUILD\` | \`lib/util\`, \`tools\` | \`lib/util\`, \`app/server\` | | the macro in \`tools/defs.bzl\` | \`tools\` | every package that loads it | Every row names \`tools\`, the package that \*defines\* the macro, and misses the packages that depend on the change. In a workspace with external dependencies the gap widens: \`buildfiles()\` also returns the \`.bzl\` files of every ruleset you load, so the scope list fills up with entries like \`@rules\_kotlin//kotlin\` that mean nothing to your queue. Reverse-dependency queries such as \`rdeps()\` close part of the gap but open another: a pull request that only edits \`BUILD\` or \`.bzl\` files has no changed \*target\* to start from, so the query returns nothing at all. :::caution If your pipeline derives scopes from changed file paths, it is under-reporting. Move it to impacted targets before relying on scopes to keep conflicting pull requests apart. ::: ## Detecting Scopes with bazel-diff bazel-diff compares two revisions, so the job that computes scopes needs three things: - \*\*A JVM.\*\* bazel-diff ships as a single \`bazel-diff\_deploy.jar\` on its \[releases page\](https://github.com/Tinder/bazel-diff/releases). - \*\*Full git history\*\*, so the base commit exists locally. With \`actions/checkout\` that means \`fetch-depth: 0\`. - \*\*A working tree it can move.\*\* Hashes are generated once per revision, so the job checks out the base, then the head. The detection itself is three bazel-diff commands, run against the merge-queue-aware \`$BASE\` and \`$HEAD\` revisions each pipeline resolves for itself: \`\`\`bash curl -fsSL -o /tmp/bazel-diff.jar \\ "https://github.com/Tinder/bazel-diff/releases/download/v42.0.0/bazel-diff\_deploy.jar" echo "0170b70fe2f24477ab056c11f5c3240d8b45a1dca5ab73ad252c096679c5500c /tmp/bazel-diff.jar" \\ | sha256sum -c - || exit 1 git checkout --quiet --force --end-of-options "$BASE" -- || exit 1 java -jar /tmp/bazel-diff.jar generate-hashes \\ --workspacePath "$(pwd)" --includeTargetType /tmp/base-hashes.json git checkout --quiet --force --end-of-options "$HEAD" -- || exit 1 java -jar /tmp/bazel-diff.jar generate-hashes \\ --workspacePath "$(pwd)" --includeTargetType /tmp/head-hashes.json java -jar /tmp/bazel-diff.jar get-impacted-targets \\ --workspacePath "$(pwd)" --targetType Rule \\ --startingHashes /tmp/base-hashes.json --finalHashes /tmp/head-hashes.json \\ | awk -F: '/^\\/\\// { print $1 }' | sort -u \`\`\` A few details worth knowing: - \`--targetType Rule\` keeps rules and drops the source and generated files that share their packages. \`--includeTargetType\` on \`generate-hashes\` is what records the type, so the two flags go together. - The \`awk\` turns each impacted label into its package label, so \`//lib/core:core\` becomes \`//lib/core\` and a target in the root package becomes \`//\`. It also drops labels from external repositories, which are not yours to queue on. - Scoping on packages rather than targets is a choice, and yours to change. \`get-impacted-targets\` reports target labels and has no package output of its own, so the reduction has to happen somewhere. Doing it here keeps scope names short and stable, at the price of serializing two pull requests that impact different targets in the same package. Drop the \`-F:\` and print the whole label instead if you want that finer grain, keeping the \`/^\\/\\//\` filter so external labels stay out. - Whichever grain you pick, the label can be given a capacity of its own: \[\`scopes.capacities\`\](/merge-queue/queue-modes#limiting-concurrency-per-scope) takes any name the scopes API accepts when the source is \`manual\`, so \`//lib/core: 2\` caps that package. A key holding \`\*\`, \`?\`, \`\[\` or \`{\` is \[a glob over scope names\](/merge-queue/queue-modes#naming-scopes-with-patterns) instead, so \`//lib/\*\*\` gives every package under \`//lib\` its own budget. To bound the rest, \[\`scopes.default\_capacity\`\](/merge-queue/queue-modes#capping-scopes-you-did-not-list) applies to every scope no key matches. - \`git checkout --force\` is deliberate: \`bazel\` writes to \`MODULE.bazel.lock\`, and a plain checkout refuses to move over the modified file. Run this on a CI checkout, not a working tree you care about. - \`--end-of-options\` and the trailing \`--\` pin \`$BASE\` and \`$HEAD\` as revisions, so git reads them neither as options nor as paths that happen to exist. \`|| exit 1\` then makes a rejected value stop the job: without it the checkout fails, hashing continues against whatever revision is still checked out, and the pull request gets a confident scope list computed from the wrong tree. - Both revisions are hashed in the same directory, so the Bazel server and its analysis cache stay warm and the second \`generate-hashes\` costs a fraction of the first. The block is long next to the \`buildfiles()\` query it replaces, and almost all of the extra length is the download, its verification and the second checkout rather than the query itself. bazel-diff ships a \`bazel-diff-example.sh\` that wraps the same sequence, but running it means cloning the bazel-diff repository into your job, which trades a pinned and verified artifact for a moving branch. Spelling the steps out is the price of not doing that. \[Running bazel-diff as a service\](#running-bazel-diff-as-a-service) removes most of them. :::note On a Bzlmod-only workspace, \`generate-hashes\` logs \`no such package 'external'\` while it queries the legacy \`//external\` package. Hashing continues and the result is unaffected; pass \`--excludeExternalTargets\` to silence it. ::: ### Installing bazel-diff bazel-diff is a Bazel module, so a workspace already on Bzlmod can declare it instead of downloading anything: \`\`\`bazel bazel\_dep(name = "bazel-diff", version = "42.0.0") \`\`\` \`\`\`bash bazel run @bazel-diff//cli:bazel-diff -- generate-hashes --workspacePath "$(pwd)" hashes.json \`\`\` That is the install bazel-diff recommends, and it is the better one for running the tool by hand. Every pipeline here uses the released JAR regardless, for one reason: they check out two revisions of your workspace, and \`bazel run @bazel-diff//...\` resolves against whichever \`MODULE.bazel\` is checked out at the time. At \`$BASE\` that is the file as it stood then, which may pin a different version or not declare bazel-diff at all. That covers every base older than the commit adding the dependency, including the pull request that adds it. A JAR fetched once, outside the workspace, is the same tool at both revisions, which is how bazel-diff's own two-revision examples invoke it. ### Verifying the download Each pipeline downloads a JAR over the network and runs it with the same privileges as the rest of the job, so the first command names exactly what runs: the URL points at a version instead of \`latest\`, and \`sha256sum -c\` checks the bytes behind it. Recompute the digest when you bump the version: \`\`\`bash sha256sum bazel-diff\_deploy.jar # shasum -a 256 on macOS \`\`\` The release also ships \[SLSA\](https://slsa.dev/) provenance beside the JAR, a stronger claim than a digest: it says the artifact came out of the project's own release workflow, not just that its bytes match something someone published. The \[GitHub CLI\](https://cli.github.com/) checks it and exits non-zero if the provenance does not hold: \`\`\`bash curl -fsSL -o /tmp/bazel-diff.jar.intoto.jsonl \\ "https://github.com/Tinder/bazel-diff/releases/download/v42.0.0/bazel-diff\_deploy.jar.intoto.jsonl" gh attestation verify /tmp/bazel-diff.jar \\ --bundle /tmp/bazel-diff.jar.intoto.jsonl \\ --repo Tinder/bazel-diff --signer-repo bazel-contrib/.github \`\`\` \`--signer-repo\` is needed because bazel-diff releases through the shared \`bazel-contrib/.github\` workflow, so the signing identity is that workflow rather than the bazel-diff repository itself. :::note \`sha256sum\` comes from GNU coreutils and is not installed on macOS. On a macOS agent, use \`shasum -a 256 -c -\` in place of \`sha256sum -c -\`. ::: \### GitHub Actions \`\`\`yaml name: Detect Scopes on: pull\_request: jobs: detect-scopes: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 with: # The queue-aware base commit must exist locally to be checked out. fetch-depth: 0 - uses: actions/setup-java@v4 with: distribution: temurin java-version: '21' - name: Get git refs id: refs uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-git-refs - name: Get scopes id: scopes env: HEAD: ${{ steps.refs.outputs.head }} BASE: ${{ steps.refs.outputs.base }} run: | # scopes-git-refs reports an empty base on any event that is neither # a pull request nor a push. Checking out an empty revision, or # letting the tool fall back to a default base, reports scopes for # the wrong range. \[ -n "$BASE" \] || { echo "no base ref reported" >&2; exit 1; } curl -fsSL -o /tmp/bazel-diff.jar \\ "https://github.com/Tinder/bazel-diff/releases/download/v42.0.0/bazel-diff\_deploy.jar" echo "0170b70fe2f24477ab056c11f5c3240d8b45a1dca5ab73ad252c096679c5500c /tmp/bazel-diff.jar" \\ | sha256sum -c - || exit 1 git checkout --quiet --force --end-of-options "$BASE" -- || exit 1 java -jar /tmp/bazel-diff.jar generate-hashes \\ --workspacePath "$(pwd)" --includeTargetType /tmp/base-hashes.json git checkout --quiet --force --end-of-options "$HEAD" -- || exit 1 java -jar /tmp/bazel-diff.jar generate-hashes \\ --workspacePath "$(pwd)" --includeTargetType /tmp/head-hashes.json # The impacted targets land in a file rather than straight into the awk # pipeline: a pipeline reports its last command's status, so a failed # bazel-diff would go unnoticed and upload an empty scope list. java -jar /tmp/bazel-diff.jar get-impacted-targets \\ --workspacePath "$(pwd)" --targetType Rule \\ --startingHashes /tmp/base-hashes.json --finalHashes /tmp/head-hashes.json \\ > /tmp/impacted.txt || exit 1 scopes=$(awk -F: '/^\\/\\// { print $1 }' /tmp/impacted.txt | sort -u | paste -sd, -) echo "scopes=$scopes" >> "$GITHUB\_OUTPUT" - name: Scopes upload uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-upload token: ${{ secrets.MERGIFY\_TOKEN }} scopes: ${{ steps.scopes.outputs.scopes }} \`\`\` ### Buildkite Using the \[\`mergifyio/mergify-ci\`\](https://github.com/Mergifyio/mergify-ci-buildkite-plugin) Buildkite plugin, a first step resolves the merge-queue-aware base and head SHAs and exposes them as meta-data, a second computes the impacted packages with bazel-diff into the \`mergify-ci.scopes\` meta-data, and a third uploads them. The upload runs in its own step because the plugin replaces the step's command, so a step that both detects and uploads never runs its detection: \`\`\`yaml steps: - label: ":mag: Get git refs" key: git-refs plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-git-refs - label: ":mag: Detect scopes" key: detect-scopes depends\_on: git-refs command: | # The base meta-data is only published when a base was resolved, so a # missing key means there is no base to check out. Check the value too: # an empty one would send the tool back to a default base and report # scopes for the wrong range. BASE=$(buildkite-agent meta-data get "mergify-ci.base") || exit 1 HEAD=$(buildkite-agent meta-data get "mergify-ci.head") || exit 1 \[ -n "$$BASE" \] || { echo "no base ref reported" >&2; exit 1; } curl -fsSL -o /tmp/bazel-diff.jar \\ "https://github.com/Tinder/bazel-diff/releases/download/v42.0.0/bazel-diff\_deploy.jar" echo "0170b70fe2f24477ab056c11f5c3240d8b45a1dca5ab73ad252c096679c5500c /tmp/bazel-diff.jar" \\ | sha256sum -c - || exit 1 git checkout --quiet --force --end-of-options "$$BASE" -- || exit 1 java -jar /tmp/bazel-diff.jar generate-hashes \\ --workspacePath "$(pwd)" --includeTargetType /tmp/base-hashes.json git checkout --quiet --force --end-of-options "$$HEAD" -- || exit 1 java -jar /tmp/bazel-diff.jar generate-hashes \\ --workspacePath "$(pwd)" --includeTargetType /tmp/head-hashes.json # The impacted targets land in a file rather than straight into the awk # pipeline: a pipeline reports its last command's status, so a failed # bazel-diff would go unnoticed and upload an empty scope list. java -jar /tmp/bazel-diff.jar get-impacted-targets \\ --workspacePath "$(pwd)" --targetType Rule \\ --startingHashes /tmp/base-hashes.json --finalHashes /tmp/head-hashes.json \\ > /tmp/impacted.txt || exit 1 SCOPES=$(awk -F: '/^\\/\\// { print $$1 }' /tmp/impacted.txt | sort -u | paste -sd, -) buildkite-agent meta-data set "mergify-ci.scopes" "$$SCOPES" - label: ":mag: Upload scopes" depends\_on: detect-scopes plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-upload \`\`\` The plugin reads your \[application key\](/api/usage) from \`MERGIFY\_TOKEN\` in the agent's environment. Without it the step still runs, but it logs a warning and sends nothing, and the build stays green, so a missing token looks like a pipeline that reports no scopes. \### Any CI (Mergify CLI) /tmp/impacted.txt || exit 1 awk -F: '/^\\/\\// { print $1 }' /tmp/impacted.txt | sort -u \\ | jq -R -s '{scopes: split("\\n") | map(select(length > 0))}' > scopes.json\`} /> \## Reducing the cost Two \`generate-hashes\` runs cost roughly two \`bazel query\` passes over the graph. On most repositories that is a small job, but there are ways to trim it: - \*\*Cache the base hashes.\*\* On \`pull\_request\` events the base is usually the same commit across many pull requests. Storing \`base-hashes.json\` under a cache key derived from the base SHA removes one checkout and one hash from most runs. - \*\*Scope the content hashing.\*\* \`generate-hashes --modified-filepaths\` reads only the files listed in a changed-file list instead of every source file. The list must be a superset of what actually changed, or the targets behind a missing file are skipped, which is why the flag is still marked experimental. ### Running bazel-diff as a service For a workspace large enough that \`generate-hashes\` dominates the job, \`bazel-diff serve\` removes those runs rather than trimming them: a long-lived process holds its own clone of the workspace, caches the hashes it generates per commit SHA, and answers impacted-target queries over HTTP. \`\`\`bash java -jar bazel-diff\_deploy.jar serve \\ --workspacePath /path/to/workspace-clone \\ --cacheDir /var/cache/bazel-diff \\ --port 8080 \`\`\` The CI step then drops the JVM, the second checkout and both hashing runs: \`\`\`bash curl -fsSL --get "http://bazel-diff.internal:8080/impacted\_targets" \\ --data-urlencode "from=$BASE" --data-urlencode "to=$HEAD" \\ -o /tmp/impacted.json || exit 1 jq -r '.impactedTargets\[\]' /tmp/impacted.json | awk -F: '/^\\/\\// { print $1 }' | sort -u \`\`\` The response is written to a file and the pipeline reads it back, so that a failed request stops the job. Piping \`curl\` straight into \`jq\` would hide it: an instance that answers \`503\` because it is still fetching leaves \`curl\` failing while \`jq\` succeeds on empty input, and the pull request goes up with no scopes at all. What you take on in exchange is a service to run: a host, a clone to keep fetched, and a \`/health\` endpoint to route on, since an instance reports unhealthy until its first fetch finishes. The query service is experimental, and documented in the \[bazel-diff README\](https://github.com/Tinder/bazel-diff#query-service-experimental). ## Changes the dependency graph cannot see Some changes invalidate everything while leaving no trace in the graph: a \`.bazelrc\` edit, a CI image bump, a change to a toolchain that lives outside the workspace. Two mechanisms cover them. On the Bazel side, list those files in a file passed to \`generate-hashes --seed-filepaths\`. Their content is mixed into every target hash, so editing one of them marks the whole graph impacted. On the Mergify side, mark the pull request as a \[barrier\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope) instead of enumerating scopes. With \`gha-mergify-ci\`, set \`all\_scopes: true\` on the \`scopes-upload\` action; with the CLI, pass \`--all\` to \`mergify ci scopes-send\`. The queue then serializes around that pull request. ## When bazel-diff is more than you want bazel-diff costs a JVM and a second checkout. If that is more than the job is worth, prefer \[file-pattern scopes\](/merge-queue/scopes/file-patterns) over a dependency-graph query you cannot trust: patterns are coarse, but they need no CI job at all and they never quietly claim a change is smaller than it is. --- # Unknown \--- title: Merge Queue Scopes description: Understand how Mergify groups pull requests by scope to build the most effective batches. --- Mergify scopes describe the areas of your codebase that a pull request touches. By attaching scopes to pull requests, the merge queue can build smarter batches, reuse the same CI work, and avoid mixing unrelated changes. Scopes also let the queue skip work entirely: when a pull request is only behind the base branch by merges in scopes it does not touch, \[Direct Merge\](/merge-queue/direct-merge) merges it right away, with no queue CI run at all. Looking to use scopes outside of the merge queue? The same scopes can skip unaffected CI jobs on pull requests. See the \[GitHub Actions\](/integrations/gha#job-selection) and \[Buildkite\](/integrations/buildkite#job-selection) integrations. Here's a quick walkthrough of how we use scopes on Mergify's own monorepo: \## Scope-aware batching at a glance When several pull requests are eligible for the next batch, Mergify compares each candidate's scopes with the ones the batch already holds and prefers the closest match: the scopes the two have in common, out of every scope either side names. Pull requests that overlap in scope are tested together first, while unrelated changes stay in the queue until a compatible batch is available or Mergify needs them to fill the requested batch size. \`\`\`dot class="queue" title="Scope-aware batch selection: the three pull requests that share frontend and api form the batch; the tooling change waits" digraph { edge \[arrowhead=none\]; subgraph cluster\_preferred { class="batch"; label="Preferred batch"; PR1 \[label="PR #101\\nScopes: frontend, api", class="queued"\]; PR2 \[label="PR #214\\nScopes: frontend", class="queued"\]; PR3 \[label="PR #305\\nScopes: api, docs", class="queued"\]; } PR4 \[label="PR #412\\nScope: tooling", class="muted"\]; frontend \[shape=oval, class="config"\]; api \[shape=oval, class="config"\]; docs \[shape=oval, class="config"\]; tooling \[shape=oval, class="config"\]; PR1 -> frontend; PR1 -> api; PR2 -> frontend; PR3 -> api; PR3 -> docs; PR4 -> tooling; } \`\`\` In the example above, the queue selects the three pull requests that share the \`frontend\` and \`api\` scopes first. The change that only touches the \`tooling\` scope is kept aside unless Mergify needs it later to complete the batch. ## How Mergify builds scope-aware batches Scope-aware batching follows these steps: 1. \*\*Collect candidates:\*\* Mergify looks at the next pull requests in queue order that pass the queue rules and are ready to batch. 2. \*\*Score overlap:\*\* It scores each candidate against the scopes already selected: the scopes the two have in common, out of every scope either side names. The highest score wins, so a candidate matching the batch's scopes exactly beats one that shares them and names several more. 3. \*\*Fill the batch:\*\* If the required \`batch\_size\` is not reached with strongly overlapping scopes, Mergify expands the selection to the best remaining options so the batch can still start. 4. \*\*Fall back to changed directories, then to queue time:\*\* When scopes leave two candidates tied, Mergify compares the directories each pull request changes, and only then falls back to queue time. A batch is still built when nothing shares a scope. This strategy maximizes CI reuse: tests that run for one pull request are likely valid for the other changes in the batch because they touch the same areas of the codebase. \[How Pull Requests Are Grouped Into a Batch\](/merge-queue/batches#how-pull-requests-are-grouped-into-a-batch) covers the full order of precedence, including how priority and stacks come before scopes. ## Scope assignment lifecycle Scopes can be attached to pull requests automatically or manually: - \*\*File pattern detection:\*\* Define scopes directly in your configuration and Mergify evaluates them itself, matching each pull request's changed files against your patterns. No CI job or GitHub Action is required for the queue to batch by scope. See \[file-pattern scopes\](/merge-queue/scopes/file-patterns) for a step-by-step setup. - \*\*Manual upload:\*\* Use the \[\`gha-mergify-ci\`\](https://github.com/Mergifyio/gha-mergify-ci) GitHub Action, the \[REST API\](/api/pull-requests), or the \`mergify ci scopes-send\` CLI to push scopes computed by your own tooling. There is a build tool guide for \[Nx\](/merge-queue/scopes/nx), \[Bazel\](/merge-queue/scopes/bazel), \[Pants\](/merge-queue/scopes/pants) and \[Turborepo\](/merge-queue/scopes/turborepo), plus one for \[any other build tool\](/merge-queue/scopes/others). ### Limits on an upload An upload sent through the \[REST API\](/api/pull-requests) or the \[Mergify CLI\](/cli/usage) has to stay within these limits: - A scope name is at most 1024 characters. - A scope name cannot contain a NUL byte or an unpaired UTF-16 surrogate. - An upload carries at most 10,000 scopes. An upload that breaks any of them is refused in full with a \`422\`, and nothing is stored: the pull request keeps whatever was uploaded for it last, which is the stale result of an earlier run rather than no result at all. If your detection tooling can emit a generated name (a path from a build graph, for example), cap its length on your side, so an over-long name fails the job that produced it instead of leaving the queue to batch on the previous run's scopes. ## Configuration schema Declare scopes at the top level of your \`.mergify.yml\` file: \`\`\`yaml scopes: source: files: frontend: include: - apps/web/\*\*/\* api: include: - services/api/\*\*/\*.py docs: include: - docs/\*\*/\* merge\_queue\_scope: merge-queue queue\_rules: - name: default batch\_size: 3 \`\`\` ### Top-level keys - \`scopes.source\`: selects how scopes are provided. - \`files\`: map scope names to the file patterns that define them. Each entry accepts \`include\` and optional \`exclude\` lists of \[glob patterns\](/configuration/data-types#globs). - \`manual\`: instructs Mergify to expect scopes from external systems via the API or GitHub Action. - \`null\`: disables scopes entirely. - \`scopes.merge\_queue\_scope\`: optional name automatically applied to temporary merge queue pull requests (defaults to \`merge-queue\`). - \`scopes.capacities\`: optional map of scope name to the number of speculative checks that scope may run at the same time, used to limit per-scope concurrency in parallel or isolated mode. See \[Limiting concurrency per scope\](/merge-queue/queue-modes#limiting-concurrency-per-scope). A key holding \`\*\`, \`?\`, \`\[\` or \`{\` is a glob over scope names, with the syntax of the \[glob patterns\](/configuration/data-types#globs) a \`files\` source uses; any other key names one scope exactly. With a \`manual\` source an exact key may be any name the scopes API accepts, such as a Bazel package label like \`//lib/core\` or a scoped package name like \`@acme/web\`. Under any other source it must be at least two characters and match \`^\[A-Za-z0-9\_-\]+$\`, the same constraint the \`files\` source puts on the scope names you declare under it. - \`scopes.default\_capacity\`: optional capacity applied to every scope that no \`capacities\` key matches, so scope sets that change from one pull request to the next stay bounded without you listing each one. See \[Capping scopes you did not list\](/merge-queue/queue-modes#capping-scopes-you-did-not-list). - \`scopes.barrier\_files\`: optional file filters marking files that impact every scope. Only valid with a \`files\` source. A pull request that changes a matching file becomes a merge queue barrier. See \[Declaring a pull request impacts every scope\](#declaring-a-pull-request-impacts-every-scope). ### Manual source example \`\`\`yaml scopes: source: manual: queue\_rules: - name: default batch\_size: 5 \`\`\` With the configuration above you must push scopes yourself, typically from a CI job that analyses the pull request and calls \`gha-mergify-ci\` with the \`scopes-upload\` action. This is the recommended approach when build systems such as Bazel, Nx, Pants, or Turborepo already know which projects are affected. ## Declaring a pull request impacts every scope Some pull requests invalidate everything: a build-system configuration change or a shared toolchain bump. Enumerating every scope by hand is brittle, and the list goes stale as soon as your set of scopes changes. Instead, mark the change as a \*\*barrier\*\*, a pull request that impacts every scope. Mergify sets an \`all\_scopes\` flag on it and \[serializes the queue\](#barrier-behavior-in-the-queue) around it. How you set the flag depends on where your scopes come from: - \*\*File-pattern scopes:\*\* declare \`scopes.barrier\_files\` and Mergify sets the flag whenever a pull request changes a matching file. - \*\*Manual scopes:\*\* set \`all\_scopes: true\` when you upload scopes through the API or CLI. ### Barrier files (file-pattern scopes) When your scopes come from \[file patterns\](/merge-queue/scopes/file-patterns), declare the files that impact every scope under \`scopes.barrier\_files\`. Whenever a queued pull request changes a matching file, Mergify flags it with \`all\_scopes\` and treats it as a barrier, with no CI job or manual upload required. \`\`\`yaml scopes: source: files: frontend: include: - apps/web/\*\*/\* api: include: - services/api/\*\*/\*.py barrier\_files: include: - .github/workflows/\*\* - Makefile queue\_rules: - name: default batch\_size: 3 \`\`\` With this configuration, a pull request that changes \`.github/workflows/\*\*\` or \`Makefile\` (files that affect the whole repository) becomes a barrier, whichever scopes it also belongs to. \`barrier\_files\` accepts the same \`include\` and optional \`exclude\` patterns as a scope, with two constraints: - \*\*At least one \`include\` pattern is required.\*\* An empty or exclude-only filter would match every pull request and silently serialize the entire queue, so Mergify rejects it. The same rule lives in the JSON schema, so the dashboard and other config editors catch it too. - \*\*\`barrier\_files\` only works with a \`files\` source.\*\* A \`manual\` source reports the barrier through the API instead (see below), and a configuration with no source has no scopes to impact. Mergify rejects \`barrier\_files\` in either case. A renamed file is matched at both of its paths, so moving a file \*out of\* a barrier pattern makes the pull request a barrier too: the barrier file is gone from the location you declared. You can also manage these patterns from the dashboard: the \*\*Barrier files\*\* editor in the queue configuration \*\*Scopes\*\* section edits the same \`barrier\_files\` filters for file-pattern scopes. ### Marking a barrier on upload (manual scopes) When you upload scopes yourself, set the \`all\_scopes\` flag on the pull request. With the \[Mergify CLI\](/cli/usage), pass \`--all\` to \`scopes-send\`: \`\`\`bash mergify ci scopes-send -s build-system --all \`\`\` When you upload a scopes JSON file with \`--scopes-json\`, the CLI also honors an \`"all\_scopes": true\` field in the file itself, so your detection tooling can set the flag without touching the command line. You can send the flag through the \[REST API\](/api/pull-requests) as well. Address the upload by commit, so it names the revision the scopes were computed for. This endpoint needs an application key with the \[\`ci\` scope\](/api/usage#application-key-scopes); an \`admin\` key is rejected: \`\`\`bash curl -X PUT \\ -H "Accept: application/json" \\ -H "Authorization: Bearer " \\ -H "Content-Type: application/json" \\ -d '{"scopes": \["build-system"\], "all\_scopes": true}' \\ https://api.mergify.com/v1/repos///commits//scopes \`\`\` Send the pull request's head SHA, which is not always the revision your job checked out: on a \`pull\_request\` event the default checkout is a merge commit, and an upload keyed on that commit matches no pull request head. The pull-request-number variant of this endpoint still works, but it cannot record which revision it was computed for, so whichever upload arrives last takes effect, whatever head it came from. The flag complements the \`scopes\` list rather than replacing it: keep reporting the concrete scopes your tooling detected, and set \`all\_scopes: true\` on top when the change affects every target. ### Barrier behavior in the queue A pull request flagged with \`all\_scopes\` conflicts with every scope, so the merge queue treats it as a barrier: - It is never batched with other pull requests and never runs its checks in parallel with other batches. - Batches already running when it enters the queue complete first. - Every pull request queued behind it waits for it to merge, including pull requests whose scopes first appear after the barrier entered the queue. - With \[per-scope capacities\](/merge-queue/queue-modes#limiting-concurrency-per-scope), the barrier consumes one slot in every capped scope. The queue serializes at the barrier and resumes normal scope-aware batching once the flagged pull request merges. Because a barrier defeats batching and parallelism, reserve \`all\_scopes\` for changes that genuinely require testing against everything. The flag is visible in the \[merge queue status API\](/api/merge-queue) and on the draft pull request description created by the queue. ## Best practices - Keep scope names stable and small in number so batches stay meaningful. - Prefer scopes that align with your CI topology: if a test suite covers a specific service or package, create a scope with the same boundary. - Still configure sane \`batch\_max\_wait\_time\` values: scopes help Mergify pick the right pull requests, but you control how long it waits for an ideal batch. - Monitor merge queue analytics to verify that scope-aware batching increases success rate and reduces redundant CI runs; adjust scope definitions when you see batches mixing unrelated changes. --- # Unknown \--- title: Scopes with Pants description: Configure merge queue scopes from the Pants dependency graph, including the targets that depend on a change. --- \[Pants\](https://www.pantsbuild.org/) builds a dependency graph of your repository by reading your BUILD files and inferring imports from your sources. Its \`--changed\` selectors turn a commit range into the list of targets that range affects, which is exactly what a scope list has to be. ## Configuring Manual Scopes To use the manual scopes mechanism, configure Mergify to expect scopes from your CI system: \`\`\`yaml scopes: source: manual: queue\_rules: - name: default batch\_size: 5 \`\`\` ## Detecting Scopes with Pants Select the changed targets with \`--changed-diffspec\`, then ask for the targets that depend on them: \`\`\`bash pants --changed-diffspec="$BASE..$HEAD" \\ --changed-dependents=transitive \\ --no-filedeps-transitive filedeps \`\`\` ### Why \`--changed-dependents=transitive\` \`--changed-dependents\` defaults to \`none\`, which reports only the targets that own the changed files. Nothing downstream of the change appears. For a repository where \`app/server\` depends on \`lib/util\`, which depends on \`lib/core\`, editing a source file in \`lib/core\` gives: | \`--changed-dependents\` | Scopes reported | | ---------------------- | ------------------------------------- | | \`none\` (the default) | \`lib/core\` | | \`direct\` | \`lib/core\`, \`lib/util\` | | \`transitive\` | \`lib/core\`, \`lib/util\`, \`app/server\` | Only \`transitive\` describes what the change can break. Scopes are how the queue decides which pull requests to serialize, so an under-reported list makes the queue batch and parallelize changes that genuinely conflict, and makes scope-gated CI skip jobs that the change breaks. Both are wrong answers. \`--no-filedeps-transitive\` turns off the transitive mode of \`filedeps\` itself, which walks the other way: it would list the files of the affected targets' own \*dependencies\*, and \`lib/core\` does not become affected because something that imports it changed. Off is already the default, so pass it explicitly to keep a repository-level \`\[filedeps\] transitive = true\` in \`pants.toml\` from quietly reversing the direction. ### From targets to scope names \`filedeps\` prints the source and BUILD files of the targets it was given, so taking the directory of each one and deduplicating gives one scope per BUILD file directory: \`\`\`bash awk -F/ 'NF>1 { OFS="/"; NF--; print } NF==1 { print "//" }' | sort -u \`\`\` A file at the build root has no directory component, and gets \`//\`, the address Pants itself uses for the root. Reporting the target addresses instead would be finer grained, but they do not survive the upload. A target \[parametrized\](https://www.pantsbuild.org/stable/docs/using-pants/key-concepts/targets-and-build-files) over two fields is addressed \`lib/multi@interpreter\_constraints=py39,resolve=alt\`, and the comma in it splits into two meaningless scopes wherever the list is uploaded as comma-separated values. Directories also keep the list stable when a target is renamed or split. Either grain can be given a capacity of its own: \[\`scopes.capacities\`\](/merge-queue/queue-modes#limiting-concurrency-per-scope) takes any name the scopes API accepts when the source is \`manual\`, so \`lib/util: 2\` caps that directory and \`//\` caps the build root. A key holding \`\*\`, \`?\`, \`\[\` or \`{\` is \[a glob over scope names\](/merge-queue/queue-modes#naming-scopes-with-patterns) instead, so \`lib/\*\*\` gives every directory under \`lib\` its own budget. To bound the rest, \[\`scopes.default\_capacity\`\](/merge-queue/queue-modes#capping-scopes-you-did-not-list) applies to every scope no key matches. \### GitHub Actions \`\`\`yaml name: Detect Scopes on: pull\_request: jobs: detect-scopes: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 with: # Both revisions must exist locally: Pants resolves the diffspec through git. fetch-depth: 0 - name: Install Pants uses: pantsbuild/actions/init-pants@v11 with: gha-cache-key: scopes # Scope detection only loads BUILD files, so it needs none of the # named caches a build or a test run would. named-caches-hash: disable - name: Get git refs id: refs uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-git-refs - name: Get scopes id: scopes env: HEAD: ${{ steps.refs.outputs.head }} BASE: ${{ steps.refs.outputs.base }} run: | # scopes-git-refs reports an empty base on any event that is neither a # pull request nor a push. Pants reads the resulting \`..HEAD\` as an # empty range and reports no scopes at all, with a zero exit code. \[ -n "$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # Pants passes the diffspec to git with no option terminator, so pin # both values to real commits first. This also fails loudly when the # base is missing from the clone instead of reporting an empty range. base=$(git rev-parse --verify --end-of-options "$BASE^{commit}") || exit 1 head=$(git rev-parse --verify --end-of-options "$HEAD^{commit}") || exit 1 # Keep this list in sync with build\_file\_prelude\_globs: a change to a # file that belongs to no target reports nothing, which the queue # would read as "this pull request affects nothing". changed=$(git diff --name-only --diff-filter=ACMRD --end-of-options "$base" "$head" --) || exit 1 all\_scopes=false if printf '%s\\n' "$changed" | grep -qE '^(pants\\.toml|pants\\.ci\\.toml|build-support/.\*\\.py)$'; then all\_scopes=true fi # --changed-dependents defaults to \`none\`, which reports only the # targets owning the changed files and nothing downstream of them. files=$(pants --changed-diffspec="$base..$head" \\ --changed-dependents=transitive \\ --no-filedeps-transitive filedeps) || exit 1 scopes=$(printf '%s\\n' "$files" \\ | awk -F/ 'NF>1 { OFS="/"; NF--; print } NF==1 { print "//" }' \\ | sort -u | paste -sd, -) echo "Detected scopes: $scopes" echo "scopes=$scopes" >> "$GITHUB\_OUTPUT" echo "all\_scopes=$all\_scopes" >> "$GITHUB\_OUTPUT" - name: Scopes upload uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-upload token: ${{ secrets.MERGIFY\_TOKEN }} scopes: ${{ steps.scopes.outputs.scopes }} all\_scopes: ${{ steps.scopes.outputs.all\_scopes }} \`\`\` ### Buildkite Using the \[\`mergifyio/mergify-ci\`\](https://github.com/Mergifyio/mergify-ci-buildkite-plugin) Buildkite plugin, a first step resolves the merge-queue-aware base and head SHAs and exposes them as meta-data, a second computes the affected targets with Pants into the \`mergify-ci.scopes\` meta-data, and a third uploads them. The upload runs in its own step because the plugin replaces the step's command, so a step that both detects and uploads never runs its detection: \`\`\`yaml steps: - label: ":mag: Get git refs" key: git-refs plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-git-refs - label: ":mag: Detect scopes" key: detect-scopes depends\_on: git-refs command: | # The base meta-data is only published when a base was resolved, so a # missing key means there is no base to diff against. Check the value too: # Pants reads an empty base as an empty range and reports no scopes. BASE=$(buildkite-agent meta-data get "mergify-ci.base") || exit 1 HEAD=$(buildkite-agent meta-data get "mergify-ci.head") || exit 1 \[ -n "$$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # Pants passes the diffspec to git with no option terminator, so pin both # values to real commits first. BASE=$(git rev-parse --verify --end-of-options "$$BASE^{commit}") || exit 1 HEAD=$(git rev-parse --verify --end-of-options "$$HEAD^{commit}") || exit 1 # --changed-dependents defaults to \`none\`, which reports only the targets # owning the changed files and nothing downstream of them. FILES=$(pants --changed-diffspec="$$BASE..$$HEAD" \\ --changed-dependents=transitive \\ --no-filedeps-transitive filedeps) || exit 1 SCOPES=$(printf '%s\\n' "$$FILES" \\ | awk -F/ 'NF>1 { OFS="/"; NF--; print } NF==1 { print "//" }' \\ | sort -u | paste -sd, -) buildkite-agent meta-data set "mergify-ci.scopes" "$$SCOPES" - label: ":mag: Upload scopes" depends\_on: detect-scopes plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-upload \`\`\` The plugin reads your \[application key\](/api/usage) from \`MERGIFY\_TOKEN\` in the agent's environment. Without it the step still runs, but it logs a warning and sends nothing, and the build stays green, so a missing token looks like a pipeline that reports no scopes. The plugin's \`scopes-upload\` action sends the scope list on its own. To also flag a pull request as \[impacting every scope\](#changes-pants-attributes-to-no-target), upload with the Mergify CLI instead, as the Any CI tab shows. ### Any CI (Mergify CLI) 1 { OFS="/"; NF--; print } NF==1 { print "//" }' \\ | sort -u \\ | jq -R -s --argjson all "$ALL\_SCOPES" \\ '{scopes: split("\\n") | map(select(length > 0)), all\_scopes: $all}' > scopes.json\`} /> \## What Pants reports for each kind of change The list Pants returns depends on whether the changed file belongs to a target, which is not the same question as whether it changes the build: - \*\*A source file.\*\* The target that owns it, plus every target that depends on it. This is the case the recipe is built for. - \*\*A BUILD file.\*\* The targets that file defines, plus their dependents. Editing metadata such as a target's \`tags\` or \`dependencies\` reports the same scopes as editing its sources, so BUILD-only pull requests are scoped correctly. - \*\*A deleted source file.\*\* The generated per-file target is gone, so Pants reports the target generator in its place. The generator's BUILD file keeps the directory in the list, and the dependents of the deleted file are still reported. - \*\*A lockfile or a requirements file.\*\* The requirement targets it defines, plus everything that imports them. A lockfile at the build root therefore reports \`//\` and each directory that uses a requirement from it. - \*\*A file no target owns.\*\* No scopes at all. \`README.md\` gives an empty list because it really does affect nothing, but so do \`pants.toml\` and the files your \`build\_file\_prelude\_globs\` points at, which affect everything. The next section is about telling those apart. ## Changes Pants attributes to no target Pants answers "which targets own these files, and what depends on them". Files outside the target graph belong to no target, so a change confined to them reports an empty list whatever \`--changed-dependents\` is set to. Two of them are worth handling, because both change how every target builds: - \*\*\`pants.toml\`\*\*, and any other config file you pass through \`PANTS\_CONFIG\_FILES\`. - \*\*The BUILD file prelude\*\*, the Python files named by \`build\_file\_prelude\_globs\`. Every BUILD file loads them, but Pants does not model that as a dependency: giving a prelude file a \`python\_sources\` target of its own changes nothing, since the change is then reported as that one target with no dependents. Neither can be expressed as a scope list, so report them as a \[barrier\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope) instead. The queue serializes around a pull request flagged with \`all\_scopes\`, which is what a change to the build configuration needs. The GitHub Actions and Any CI recipes set the flag from a path match on the changed files, so keep that pattern in sync with your \`build\_file\_prelude\_globs\`. --- # Unknown \--- title: Setting Up a Merge Queue description: Get your merge queue running in 5 minutes. --- Get your first PR merged through a queue in under 5 minutes. No complex setup required. :::note New to merge queues? Learn the fundamentals at the \[Merge Queue Academy\](https://merge-queue.academy/) before diving into setup. ::: ## Quick Start ### 1. Install Mergify \[Install the Mergify GitHub App\](https://github.com/apps/mergify/installations/new) on your repository. That's it: you now have a working merge queue. ### 2. Queue Your First PR On any open pull request, comment: \`\`\`text @mergifyio queue \`\`\` ![Mergify queue command](https://docs.mergify.com/merge-queue/%7BqueueCommandScreenshot%7D) Mergify adds your PR to the queue, updates it against the latest main branch, waits for CI to pass, and merges it automatically. \### 3. Watch It Work Open the \[Mergify dashboard\](https://dashboard.mergify.com) to see your PR moving through the queue in real-time. ![Mergify Queue Status](https://docs.mergify.com/merge-queue/%7BqueueStatusScreenshot%7D) \*\*That's it.\*\* Your merge queue is live. ## What You Get Immediately With zero configuration, your queue already: - \*\*Updates PRs\*\* against the latest main before merging - \*\*Runs your CI\*\* on the updated code (not stale branches) - \*\*Merges automatically\*\* when checks pass - \*\*Respects your \[GitHub branch protections and rulesets\](/merge-queue/github-rulesets)\*\* This alone prevents the classic problem: PRs that pass CI individually but break main when merged together. ## Next Steps Once your basic queue is running, explore these optimizations: | Goal | Feature | Guide | |------|---------|-------| | Skip manual queueing | Auto-queue approved PRs | \[Auto-Merge\](/merge-protections/auto-merge) | | Merge faster | Test multiple PRs in parallel | \[Parallel checks\](/merge-queue/performance#parallel-checks) | | Save CI costs | Combine PRs into single CI runs | \[Batches\](/merge-queue/batches) | | Prioritize urgent PRs | Jump the queue when needed | \[Priority\](/merge-queue/priority) | | Run heavy tests only at merge | Split fast/slow CI checks | \[Two-step CI\](/merge-queue/two-step) | | Monorepo optimization | Only test affected code | \[Scopes\](/merge-queue/scopes) | --- # Unknown \--- title: Scopes with Turborepo description: Configure merge queue scopes using Turborepo's dependency graph awareness. --- If you're using monorepo tools like Turborepo that have built-in dependency graph analysis, you can use their affected project detection instead of file patterns. This approach is often more accurate because these tools understand your project's dependency relationships. ## Configuring Manual Scopes To use the manual scopes mechanism, configure Mergify to expect scopes from your CI system: \`\`\`yaml scopes: source: manual: queue\_rules: - name: default batch\_size: 5 \`\`\` ## Detecting Scopes with Turborepo Use the \`turbo run build --dry=json\` command to determine affected projects and upload them to Mergify. \### GitHub Actions \`\`\`yaml name: Detect Scopes on: pull\_request: jobs: detect-scopes: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 with: # The queue-aware base commit must exist locally: turbo resolves # the base/head range through git. fetch-depth: 0 - name: Get git refs id: refs uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-git-refs - name: Get scopes id: scopes env: HEAD: ${{ steps.refs.outputs.head }} BASE: ${{ steps.refs.outputs.base }} run: | # scopes-git-refs reports an empty base on any event that is neither # a pull request nor a push. Diffing against an empty revision, or # letting the build tool fall back to its own default base, reports # scopes for the wrong range. \[ -n "$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # A failed turbo piped into jq still exits 0 and writes an empty # scope list, which the queue reads as "this pull request affects # nothing", so capture the dry run first. dry=$(npx turbo run build --dry=json --filter="\[$BASE...$HEAD\]") || exit 1 scopes=$(printf '%s' "$dry" | jq -r '.packages | join(",")') echo "scopes=$scopes" >> "$GITHUB\_OUTPUT" - name: Scopes upload uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-upload token: ${{ secrets.MERGIFY\_TOKEN }} scopes: ${{ steps.scopes.outputs.scopes }} \`\`\` ### Buildkite Using the \[\`mergifyio/mergify-ci\`\](https://github.com/Mergifyio/mergify-ci-buildkite-plugin) Buildkite plugin, a first step resolves the merge-queue-aware base and head SHAs and exposes them as meta-data, a second computes the affected projects with \`turbo run build --dry=json\` into the \`mergify-ci.scopes\` meta-data, and a third uploads them. The upload runs in its own step because the plugin replaces the step's command, so a step that both detects and uploads never runs its detection: \`\`\`yaml steps: - label: ":mag: Get git refs" key: git-refs plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-git-refs - label: ":mag: Detect scopes" key: detect-scopes depends\_on: git-refs command: | # The base meta-data is only published when a base was resolved, so a # missing key means there is no base to diff against. Check the value # too: an empty one would send the build tool back to its own default # base and report scopes for the wrong range. BASE=$(buildkite-agent meta-data get "mergify-ci.base") || exit 1 HEAD=$(buildkite-agent meta-data get "mergify-ci.head") || exit 1 \[ -n "$$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # A failed turbo piped into jq still exits 0 and writes an empty scope # list, which the queue reads as "this pull request affects nothing", # so capture the dry run first. DRY=$(npx turbo run build --dry=json --filter="\[$$BASE...$$HEAD\]") || exit 1 SCOPES=$(printf '%s' "$$DRY" | jq -r '.packages | join(",")') buildkite-agent meta-data set "mergify-ci.scopes" "$$SCOPES" - label: ":mag: Upload scopes" depends\_on: detect-scopes plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-upload \`\`\` The plugin reads your \[application key\](/api/usage) from \`MERGIFY\_TOKEN\` in the agent's environment. Without it the step still runs, but it logs a warning and sends nothing, and the build stays green, so a missing token looks like a pipeline that reports no scopes. \### Any CI (Mergify CLI) scopes.json || exit 1\`} /> Whichever recipe you use, the scopes it uploads are the package names \`turbo\` reports under \`.packages\`, and a scoped name such as \`@acme/web\` can be given a capacity of its own: \[\`scopes.capacities\`\](/merge-queue/queue-modes#limiting-concurrency-per-scope) takes any name the scopes API accepts when the source is \`manual\`. Quote it in YAML, since a key starting with \`@\` is not a plain scalar. A key holding \`\*\`, \`?\`, \`\[\` or \`{\` is \[a glob over scope names\](/merge-queue/queue-modes#naming-scopes-with-patterns) instead, so \`'@acme/\*'\` gives every \`@acme/\` package its own budget. To bound the rest, \[\`scopes.default\_capacity\`\](/merge-queue/queue-modes#capping-scopes-you-did-not-list) applies to every scope no key matches. --- # Unknown \--- title: Scopes with Nx description: Configure merge queue scopes using Nx's dependency graph to drive batching. --- If you're using tools like the Nx build system that have built-in dependency graph analysis, you can use their affected project detection instead of file patterns. This approach is often more accurate because these tools understand your project's dependency relationships. ## Configuring Manual Scopes To use the manual scopes mechanism, configure Mergify to expect scopes from your CI system: \`\`\`yaml scopes: source: manual: queue\_rules: - name: default batch\_size: 5 \`\`\` ## Detecting Scopes with Nx Use the \`nx show projects\` command to determine affected projects and upload them to Mergify. \### GitHub Actions \`\`\`yaml name: Detect Scopes on: pull\_request: jobs: detect-scopes: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 with: # The queue-aware base commit must exist locally: nx resolves the # base/head range through git. fetch-depth: 0 - name: Get git refs id: refs uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-git-refs - name: Get scopes id: scopes env: HEAD: ${{ steps.refs.outputs.head }} BASE: ${{ steps.refs.outputs.base }} run: | # scopes-git-refs reports an empty base on any event that is neither # a pull request nor a push. Diffing against an empty revision, or # letting the build tool fall back to its own default base, reports # scopes for the wrong range. \[ -n "$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # A failed nx piped into paste still exits 0 and writes an empty # scope list, which the queue reads as "this pull request affects # nothing", so capture the projects first. projects=$(npx nx show projects --affected --base="$BASE" --head="$HEAD") || exit 1 scopes=$(printf '%s\\n' "$projects" | paste -sd, -) echo "scopes=$scopes" >> "$GITHUB\_OUTPUT" - name: Scopes upload uses: Mergifyio/gha-mergify-ci@@@GHA\_MERGIFY\_CI\_VERSION@@ with: action: scopes-upload token: ${{ secrets.MERGIFY\_TOKEN }} scopes: ${{ steps.scopes.outputs.scopes }} \`\`\` ### Buildkite Using the \[\`mergifyio/mergify-ci\`\](https://github.com/Mergifyio/mergify-ci-buildkite-plugin) Buildkite plugin, a first step resolves the merge-queue-aware base and head SHAs and exposes them as meta-data, a second computes the affected projects with Nx into the \`mergify-ci.scopes\` meta-data, and a third uploads them. The upload runs in its own step because the plugin replaces the step's command, so a step that both detects and uploads never runs its detection: \`\`\`yaml steps: - label: ":mag: Get git refs" key: git-refs plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-git-refs - label: ":mag: Detect scopes" key: detect-scopes depends\_on: git-refs command: | # The base meta-data is only published when a base was resolved, so a # missing key means there is no base to diff against. Check the value # too: an empty one would send the build tool back to its own default # base and report scopes for the wrong range. BASE=$(buildkite-agent meta-data get "mergify-ci.base") || exit 1 HEAD=$(buildkite-agent meta-data get "mergify-ci.head") || exit 1 \[ -n "$$BASE" \] || { echo "no base ref reported" >&2; exit 1; } # A failed nx piped into paste still exits 0 and writes an empty scope # list, which the queue reads as "this pull request affects nothing", # so capture the projects first. PROJECTS=$(npx nx show projects --affected --base="$$BASE" --head="$$HEAD") || exit 1 SCOPES=$(printf '%s\\n' "$$PROJECTS" | paste -sd, -) buildkite-agent meta-data set "mergify-ci.scopes" "$$SCOPES" - label: ":mag: Upload scopes" depends\_on: detect-scopes plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: scopes-upload \`\`\` The plugin reads your \[application key\](/api/usage) from \`MERGIFY\_TOKEN\` in the agent's environment. Without it the step still runs, but it logs a warning and sends nothing, and the build stays green, so a missing token looks like a pipeline that reports no scopes. \### Any CI (Mergify CLI) 0))}' > scopes.json\`} /> --- # Unknown \--- title: Merge Queue Batches description: Increase your merge queue throughput and decrease your CI usage. --- Batch merging lets you combine and merge multiple pull requests at once, instead of merging them one by one. :::tip Learn the concepts behind batching and its trade-offs at the \[Merge Queue Academy\](https://merge-queue.academy/features/batching/). ::: The batch merging process works by setting a \`batch\_size\` option on your merge queue. This option determines the number of pull requests that Mergify will check at the same time using your CI. If the CI validation passes, Mergify merges all the pull requests in the batch and closes the batch pull request it created to test. If a failure occurs, Mergify identifies the problematic pull request(s) automatically and removes them from the queue, allowing the rest of the queue to be processed as usual (see \[Handling Batch Failures\](#handling-batch-failure-or-timeout)). This feature is especially useful for large-scale projects with many pull requests to merge, as it can reduce the time required to merge them all. \## Understanding Batch Merging Batch merging works by using the \`batch\_size\` option in your Mergify queue configuration. This option tells Mergify how many pull requests it should try to combine and validate at once. The \`batch\_size\` can be adjusted according to the needs of your project, with a higher number indicating a larger batch size. For example, if you set \`batch\_size\` to 3, Mergify will create a batch pull request that includes the changes from the next three pull requests in the queue. This batch pull request is then validated by your CI system. If all checks pass, then the three pull requests included in the batch are deemed ready to be merged. \`\`\`yaml queue\_rules: - name: default batch\_size: 3 \`\`\` \`\`\`dot class="queue" title="A batch of three pull requests is tested together, ahead of the rest of the queue" digraph { subgraph cluster\_batch1 { class="batch"; label="Batch 1"; PR1 \[class="queued"\]; PR2 \[class="queued"\]; PR3 \[class="queued"\]; PR1 -> PR2 -> PR3; } PR4 \[class="queued"\]; PR5 \[label="…", class="queued"\]; PR3 -> PR4 -> PR5; CI \[label="Continuous\\nintegration", class="external"\]; PR3 -> CI \[class="muted", style=dashed, dir=both, arrowhead=none, arrowtail=normal\]; } \`\`\` This batch merging process allows multiple pull requests to be validated and merged more efficiently than if they were handled individually. ## Configuring Batch Merging Configuring batch merging involves adjusting your Mergify configuration file to set the \`batch\_size\` option according to your project's needs. 1. Open your \[Mergify configuration file\](/configuration/file-format). 2. Under \`queue\_rules\`, set the \`batch\_size\` option to the number of pull requests you want to be tested together in a batch. \`\`\`yaml queue\_rules: - name: default batch\_size: 3 \`\`\` In the above example, batches of up to 3 pull requests will be created and tested together. ![Mergify merge queue with batches](https://docs.mergify.com/merge-queue/%7BbatchesScreenshot%7D) You can configure the delay that Mergify will use to wait for the batch to be filled up using the \`batch\_max\_wait\_time\` option. \`\`\`yaml queue\_rules: - name: default batch\_size: 5 batch\_max\_wait\_time: 5 min \`\`\` With the configuration above, Mergify waits up to 5 minutes for 5 PRs to enter the queue before creating a batch. This allows you to pick the right trade-off between latency and minimal CI usage. ## Dynamic Batch Sizing The examples above use a fixed \`batch\_size\`: every batch holds the same number of pull requests. Picking that number is a trade-off. Small batches keep latency low and make failures cheap to isolate, but spend more CI. Large batches conserve CI and clear a backlog faster, but a single failure forces Mergify to \[split and retest\](#handling-batch-failure-or-timeout) more pull requests. Dynamic batch sizing lets Mergify make that trade-off for you, in real time. Instead of a single integer, set \`batch\_size\` to a \`min\` and \`max\` range: \`\`\`yaml queue\_rules: - name: default batch\_size: min: 1 max: 10 \`\`\` Mergify then spreads the queued pull requests across the available \[parallel checks\](/merge-queue/performance#parallel-checks) and sizes each batch to stay small while keeping up with the queue: - When the queue is light, batches stay at \`min\`, so each one is fast to validate and cheap to split when it fails. - When the queue grows deeper than the parallel checks can drain at the smaller size, Mergify grows the batches toward \`max\` to keep the queue moving. For example, with \`max\_parallel\_checks: 5\` and a \`batch\_size\` range of \`min: 1\` to \`max: 2\`, three queued pull requests each become a batch of one, while ten queued pull requests become five batches of two. This gives low latency when traffic is light and high throughput when it spikes, without retuning \`batch\_size\` for every load pattern. Dynamic batch sizing works the same way in every \[queue mode\](/merge-queue/queue-modes). ## How Pull Requests Are Grouped Into a Batch When \`batch\_size\` is greater than 1, Mergify has to decide \*which\* pull requests go into a batch together. It does \*\*not\*\* simply take the next few pull requests in the queue. Instead, it groups pull requests that touch \*\*similar\*\* parts of your codebase, so each batch is a cohesive set of related changes. This makes batch failures cheaper to resolve: when a batch fails and has to be \[split\](#handling-batch-failure-or-timeout), related changes stay together and unrelated pull requests aren't dragged into someone else's failure. This is how the default \[serial mode\](/merge-queue/queue-modes#serial-mode) and \[isolated mode\](/merge-queue/queue-modes#isolated-mode) both build their batches. \[Parallel mode\](/merge-queue/queue-modes#parallel-mode) is the exception: it groups pull requests by their exact set of scopes instead. Grouping applies these rules in order of precedence: it never overrides \[priority\](/merge-queue/priority) or queue order, it always keeps a \[stack\](/merge-queue/stacks) together, and only then does similarity fill whatever batch slots remain. The sections below follow that order. ### Priority comes first Grouping never overrides \[priority\](/merge-queue/priority) or queue order. Mergify seeds each batch with the pull request that is next to merge: the highest priority, and the oldest among equal priorities. Similarity only ever breaks ties \*\*between pull requests of equal priority\*\*: a lower-priority pull request is never pulled ahead of a higher-priority one just because it is similar. Higher-priority pull requests always fill the batch first; lower priorities are only considered once the batch still has room. ### Stacks stay together Stacks are the next firm rule, applied before similarity is considered. When a pull request depends on earlier ones still in the queue (a \[stack\](/merge-queue/stacks)), Mergify keeps the whole stack in one batch: whenever a pull request joins a batch, its queued predecessors join with it, whether or not they share its scopes or changed directories. This is why stack relationships take precedence over scope and directory similarity. A predecessor joins the batch because the dependency requires it, not because it ranked highly. The only limit is \`batch\_size\`: if the stack doesn't fit, the dependent pull request waits for a later batch rather than being tested without the changes it builds on. ### Filling the batch by similarity Priority and stacks decide what a batch must contain. Similarity decides the rest: which of the remaining equal-priority pull requests fill the slots that are still free (up to \`batch\_size\`). Mergify adds them one at a time, ranking the candidates near the front of the queue by three criteria applied \*\*in order\*\*, each one only breaking the ties the previous one leaves open: 1. \*\*\[Scopes\](/merge-queue/scopes).\*\* Mergify compares a candidate's scopes against the batch's as a proportion: the scopes the two have in common, out of every scope either side names. A candidate whose scopes match the batch's exactly scores highest, and it outranks one that shares those scopes but names several more of its own. 2. \*\*Changed directories.\*\* When scopes don't separate two candidates, Mergify compares the \*\*directories each pull request changes\*\* and prefers the one touching the same areas of the repository. On very large monorepos it automatically compares broader areas (parent directories) rather than every individual folder, so grouping stays effective whatever the repository size. 3. \*\*Queue time.\*\* If two pull requests are still tied, the one that has been waiting longest joins the batch first, keeping first-in, first-out order. Scopes always take precedence over directories; the changed directories only decide the grouping when scopes leave it open. In practice this depends on your configuration: if you have configured \[scopes\](/merge-queue/scopes), pull requests are grouped by scope and the directory signal stays out of the way. If you have not, every pull request reports no scope, so that signal is a tie for all of them and grouping falls back entirely to the directories they change. Because of this, a pull request further down the queue may join an earlier batch when it is similar to what is already there, while a closer but unrelated pull request waits for the next batch: \`\`\`dot class="queue" title="batch\_size: 2 — pull requests that touch the same area are grouped together" digraph { edge \[style=invis\]; subgraph cluster\_batch1 { class="batch"; label="Batch 1"; PR1 \[label="PR #1\\n(api/)", class="queued"\]; PR3 \[label="PR #3\\n(api/)", class="queued"\]; } subgraph cluster\_batch2 { class="batch"; label="Batch 2"; PR2 \[label="PR #2\\n(docs/)", class="queued"\]; PR4 \[label="PR #4\\n(web/)", class="queued"\]; } PR1 -> PR3 -> PR2 -> PR4; } \`\`\` Here the queue order is PR #1, #2, #3, #4. PR #3 changes the same area as PR #1 (\`api/\`), so it joins PR #1 in the first batch even though PR #2 was queued earlier. PR #2 and PR #4, which touch unrelated areas, fall into the next batch. Similarity only reaches a short way down the queue. Mergify fills a batch from a window at the front of the queue, a little wider than \`batch\_size\` and wider still as \[\`max\_parallel\_checks\`\](/merge-queue/performance#parallel-checks) grows. A similar pull request sitting further back than that window is not pulled forward; it waits for a batch whose window reaches it. This keeps the queue close to first-in, first-out, so a pull request with no similar neighbor is not deferred batch after batch while better matches are found ahead of it. :::note Grouping only considers the pull requests waiting in the queue when a batch is assembled. Use \[\`batch\_max\_wait\_time\`\](#configuring-batch-merging) to let Mergify wait for more pull requests to arrive before assembling a batch, which gives the grouping more candidates to work with. ::: ## Merging the Batch PRs By default, Mergify creates temporary branches and batch PRs for testing batches. However, the original PRs are the ones merged, not these temporary branches. This ensures the integrity and traceability of the original pull requests. However, there might be scenarios where you want to merge the temporary branches instead. One advantage of this is maintaining the same SHA1, which might be important for some workflows and for traceability. Also, if you are deploying after a merge, this can make sure that you trigger only a single deployment once a batch of pull requests is fully tested and passes the CI. There are two ways to merge the batch PR directly: ### Fast-Forward Set \`merge\_method: fast-forward\` on your queue rule. When batching is enabled, Mergify creates the batch PR as usual, runs CI on it, and then fast-forwards the base branch to the batch PR's head commit instead of merging the original PRs individually. \`\`\`yaml queue\_rules: - name: default batch\_size: 10 merge\_method: fast-forward \`\`\` Fast-forward only works in serial mode. \[Parallel and isolated modes\](/merge-queue/queue-modes) merge their batches independently, which fast-forward cannot do, so Mergify rejects a configuration that combines them rather than failing at merge time. See \[Merge Strategies: Fast-Forward\](/merge-queue/merge-strategies#fast-forward) for a detailed explanation of how fast-forward works in both inplace and batch-PR modes. :::caution If GitHub branch protections are enabled, fast-forward requires some additional configuration in branch protection settings: you also need to allow Mergify to "bypass the required pull requests" to merge. This is mandatory since Mergify pushes the temporary branch to the base branch without going through a pull request to keep the same SHA1. ![Mergify bypass required pull requests](https://docs.mergify.com/merge-queue/%7BrequiredPRbypassScreenshot%7D) ::: ### Merge Batch Set \`merge\_method: merge-batch\` on your queue rule. This merge method requires \`batch\_size\` to be greater than 1. Mergify creates the batch PR as usual, runs CI on it, and then merges the batch PR into the base branch using the GitHub pull request merge API with a merge commit. The merge commit message lists all the pull requests included in the batch. \`\`\`yaml queue\_rules: - name: default batch\_size: 10 merge\_method: merge-batch \`\`\` Unlike \`fast-forward\`, \`merge-batch\` uses the standard GitHub merge API, so it works with branch protection settings that require pull request merges: no bypass configuration is needed. See \[Merge Strategies: Merge Batch\](/merge-queue/merge-strategies#merge-batch) for more details. ## Handling Batch Failure or Timeout When a batch fails, or when its \[checks time out\](/merge-queue/lifecycle#checks-timeout), Mergify does not remove all its pull requests from the queue. Instead, it takes additional steps to identify the problematic pull request and remove it from the queue. This is how it works: 1. \*\*Splitting the batch\*\*: If a batch fails, all subsequent batches are deemed to fail as well, are canceled and put back into the queue. The system splits the failed batch to isolate the problematic pull request. The \`max\_parallel\_checks\` parameter dictates the number of parts the failed batch is divided into, with a minimum of two. 2. \*\*Testing the new batches\*\*: After splitting, the first new batch is immediately retested, while others are queued. If \`max\_parallel\_checks\` is greater than 1, the system will also test subsequent batch splits at the same time. This continues until the split is done. 3. \*\*Handling the result\*\*: If the first batch split succeeds, it is merged and the next split is scheduled for testing. If the batch fails, Mergify splits this batch, going back to step 1. 4. \*\*Pin-pointing the failed batch\*\*: If a batch contains only one pull request and still fails, it is deemed to be the culprit and is removed from the queue. Note that this system is completely automatic and there is no need to intervene. The number of maximum splits can be controlled by \[\`batch\_max\_failure\_resolution\_attempts\`\](/configuration/file-format#queue-rules). While this runs, the batches involved report a \[batch status\](/configuration/data-types#batch-status) such as \`bisecting\`, \`waiting\_for\_previous\_batches\`, or \`waiting\_for\_requeue\`, so you can follow the resolution from \[the dashboard or the CLI\](/merge-queue/monitoring). :::tip Each split carries metadata about the batches it came from. You can use it to \[re-run only the tests that failed in the parent batch\](#re-running-only-the-previously-failed-tests) instead of your whole suite on every split. ::: ### Batch Failure Scenario Example Let's assume that we have a batch of 6 pull requests: \`\[PR1 + PR2 + PR3 + PR4 + PR5 + PR6\]\`. During the initial testing, Mergify first tests the batch with all 6 pull requests together. As the batch fails, this could be due to any of the PRs or a specific combination of them. Mergify learned that the combination \`\[PR1 + PR2 + PR3 + PR4 + PR5 + PR6\]\` does not work; it now needs to test parts of this combination. With \`max\_parallel\_checks\` set to 3, the system will aim to split the batch into 3 parts: - First part: \`\[PR1 + PR2\]\` - Second part: \`\[PR1 + PR2 + PR3 + PR4\]\` - Third part: \`\[PR1 + PR2 + PR3 + PR4 + PR5\]\` :::tip\[Tips\] Mergify already tested \`\[PR1 + PR2 + PR3 + PR4 + PR5 + PR6\]\` in the original batch and knows it does not work. No need to test it again! ::: The system will immediately retest the different parts since the number of splits matches the number of parallel checks allowed. If the first part \`\[PR1 + PR2\]\` passes, the system will merge it. If the first part \`\[PR1 + PR2\]\` fails, the system will split it again and test each PR individually, applying the algorithm again. If there's a consecutive failure in the subsequent parts, the system will continue to split and isolate the problematic PR(s) and retest until the split contains a single pull request. ## Re-running Only the Previously Failed Tests When Mergify \[splits a failed batch\](#handling-batch-failure-or-timeout), every split is a smaller subset of the batch that failed. Instead of re-running your full test suite on each split, you can run only the tests that failed in the parent batch. Tests that passed on the larger batch pass on the smaller one; the only tests worth re-running are those Mergify still needs to check to isolate the culprit. To make this possible, Mergify exposes the batches a split descends from to your CI, which reads them and narrows each split run down to just the tests that previously failed. ### Reading the Metadata The \[Mergify CLI\](/cli/ci) exposes the metadata with \`mergify ci queue-info\`. Run it on a merge queue batch build and it prints the queue metadata as JSON: \`\`\`json { "scopes": \["backend", "frontend"\], "all\_scopes": false, "pull\_requests": \[ { "number": 123, "scopes": \["backend"\] }, { "number": 124, "scopes": \["frontend"\] } \], "previous\_failed\_batches": \[ { "batch\_pr\_number": 980, "batch\_pr\_head\_sha": "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678", "checked\_pull\_requests": \[123, 124, 125, 126\] } \], "previous\_check\_retries": \[ { "batch\_pr\_number": 991, "batch\_pr\_head\_sha": "b2c3d4e5f60718293a4b5c6d7e8f901234567890", "attempt": 1 } \], "checking\_base\_sha": "f4a9c1e9b2d34c5a6f7081923abcde4567890123" } \`\`\` Here the current split is testing pull requests #123 and #124, and it descends from batch pull request #980, which checked #123 through #126 and failed. This same split has already run once itself, as batch pull request #991, and is being retried after its checks failed. The fields are: - \`scopes\`: the \[scopes\](/merge-queue/scopes) this batch covers, the union of the scopes of its pull requests. Empty when you do not use scopes. - \`all\_scopes\`: \`true\` when the batch holds a \[barrier\](/merge-queue/scopes#declaring-a-pull-request-impacts-every-scope) pull request, one that impacts every scope. \`scopes\` then lists only the scopes its pull requests named, often none, so test every scope. Metadata written by an older Mergify release has no \`all\_scopes\` key: treat a missing key as unknown, not as \`false\`. - \`pull\_requests\`: the pull requests the batch is checking, each with its own scopes. - \`previous\_failed\_batches\`: the failed batches this split descends from, oldest first. When a batch is split several times, each ancestor adds an entry, so the batch your split came from directly is always the \*\*last\*\* one. \`batch\_pr\_head\_sha\` is the commit that batch's CI ran on. - \`previous\_check\_retries\`: earlier runs of \*this same\* batch, re-run because their checks failed under \[\`max\_checks\_retries\`\](/merge-queue/lifecycle#automatic-ci-retries). Each entry carries its 1-indexed \`attempt\` number. - \`checking\_base\_sha\`: the commit this batch's own pull requests sit on top of — the base branch plus any pull requests queued ahead of it. Diffing from it isolates the changes the batch itself introduces. When \`$GITHUB\_OUTPUT\` is set, \`mergify ci queue-info\` also exposes the same JSON as a \`queue\_metadata\` step output, so a later step can consume it directly. :::note \`mergify ci queue-info\` reads a Git note Mergify attaches to the batch's head commit, so it works in any CI provider that checks out the merge queue branch, and it needs no GitHub token. Outside a merge queue batch build it exits with an error. ::: ### GitHub Actions Example This workflow reads the metadata, finds the most recent failed batch, downloads its failed tests, and re-runs only those. It falls back to the full suite whenever there is no previous failed batch or no artifact to reuse, so it is safe to use as your only test workflow. It assumes your test job uploads a \`failed-tests\` artifact on every run: a \`failed-tests.txt\` file with one test identifier per line. The \`previous\_failed\_batches\` optimization reuses that artifact from the parent batch's run. \`\`\`yaml name: CI on: pull\_request: jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install the Mergify CLI uses: Mergifyio/setup-cli@v2 - name: Read the merge queue metadata id: queue-info # queue-info only works on a merge queue batch build, and the metadata # is best-effort: never let missing metadata fail the job. if: startsWith(github.event.pull\_request.title, 'merge queue:') continue-on-error: true run: mergify ci queue-info - name: Download the previously failed tests id: failed-tests if: steps.queue-info.outcome == 'success' env: GH\_TOKEN: ${{ secrets.GITHUB\_TOKEN }} QUEUE\_METADATA: ${{ steps.queue-info.outputs.queue\_metadata }} run: | # Anything we can't optimize falls back to the full suite. fallback() { echo "$1, running the full test suite."; exit 0; } # The batch this split came from is the last entry of the list, and it # carries the commit its CI ran on. sha=$(jq -r '.previous\_failed\_batches\[-1\].batch\_pr\_head\_sha // empty' <<< "$QUEUE\_METADATA") \[ -n "$sha" \] || fallback "No previous failed batch" # Resolve the latest CI run of that batch. run\_id=$(gh run list --commit "$sha" --workflow CI --json databaseId -q '.\[0\].databaseId // empty') \[ -n "$run\_id" \] || fallback "No CI run for the previous failed batch" # Download the failing tests it recorded. gh run download "$run\_id" --name failed-tests --dir previous-failed-tests || fallback "No failed-tests artifact" echo "tests=$(paste -sd ' ' previous-failed-tests/failed-tests.txt)" >> "$GITHUB\_OUTPUT" - name: Run tests env: ONLY\_TESTS: ${{ steps.failed-tests.outputs.tests }} run: | if \[ -n "$ONLY\_TESTS" \]; then echo "Re-running only the previously failed tests: $ONLY\_TESTS" # $ONLY\_TESTS is unquoted so it splits into separate arguments, which # assumes test ids are shell-safe. Replace with your own runner's # filter, e.g. pytest, go test -run, etc. pytest $ONLY\_TESTS else pytest fi - name: Upload the failed tests # Record the tests that failed so the next split can re-run only those. if: always() uses: actions/upload-artifact@v4 with: name: failed-tests path: failed-tests.txt if-no-files-found: ignore \`\`\` :::note The optimization is silent when it does not engage: a wrong \`--workflow\` name or \`failed-tests\` artifact name just runs the full suite, with no error. Keep both in sync. \`--workflow CI\` must match your workflow's \`name:\` exactly, or use its filename, like \`ci.yml\`; the artifact name must match on the upload and download steps. The one positive sign it engaged is the \`Re-running only the previously failed tests:\` line in the job log. ::: :::caution This optimization assumes a test that passed on the parent batch stays green on the smaller split. That holds when your tests are independent. If a test's result depends on changes from another pull request in the batch, keep running your full suite so Mergify always isolates the right culprit. ::: ## Re-running Only the Previously Failed Jobs The same idea works one level up, at the CI job. When Mergify \[splits a failed batch\](#handling-batch-failure-or-timeout), a whole CI job that passed on the parent batch passes on the smaller split too, so it does not need to run again. Instead of re-running every job on each split, you can run only the jobs that failed on the parent. A test is filtered inside one process you control, so the previous recipe passes a list of test names to your runner. A job is a whole CI unit you cannot filter from the outside, so the mirror is self-skipping: each job checks at startup whether it already passed on the parent batch and exits early if it did. :::note GitHub's native "Re-run failed jobs" does not apply here. Mergify creates a new batch pull request with a new commit for each split, so every split is a fresh workflow run, not a re-run of the parent's run. ::: ### How a Job Decides to Skip This recipe reads the same \`mergify ci queue-info\` output as the previous one (see \[Reading the Metadata\](#reading-the-metadata)). It uses two things about the parent batch, the last entry of \`previous\_failed\_batches\`: - \`batch\_pr\_head\_sha\`: the head commit of the parent batch's pull request. Your CI ran on that commit, so its check runs are the source of truth for which jobs passed there. - The job's own check run on that commit: a job skips itself only when its check run concluded \`success\`. Anything else, a failure, a job that never ran, or a missing SHA, runs the full job. ### GitHub Actions Example: Self-skipping Jobs This job reads the parent batch's head SHA from the metadata, looks up its own check run on that commit, and skips its real steps when it already passed. It falls back to running in full whenever any piece is missing, so it is safe to use as your only workflow. \`\`\`yaml name: CI on: pull\_request: jobs: build: runs-on: ubuntu-latest permissions: contents: read # actions/checkout checks: read # read the parent batch's check runs steps: - uses: actions/checkout@v4 - name: Install the Mergify CLI uses: Mergifyio/setup-cli@v2 - name: Read the merge queue metadata id: queue-info # queue-info only works on a merge queue batch build, and the metadata # is best-effort: never let missing metadata fail the job. if: startsWith(github.event.pull\_request.title, 'merge queue:') continue-on-error: true run: mergify ci queue-info - name: Skip this job if it already passed on the parent batch id: already-passed if: steps.queue-info.outcome == 'success' env: GH\_TOKEN: ${{ secrets.GITHUB\_TOKEN }} QUEUE\_METADATA: ${{ steps.queue-info.outputs.queue\_metadata }} REPO: ${{ github.repository }} # The check-run name GitHub gives this job, matched verbatim below. # It is the job's \`name:\` (or its id when unset). See the note on # matrix jobs. JOB: build run: | # Anything we can't resolve falls back to a full run. fallback() { echo "$1, running the full job."; exit 0; } # The batch this split came from is the last entry of the list. sha=$(jq -r '.previous\_failed\_batches\[-1\].batch\_pr\_head\_sha // empty' <<< "$QUEUE\_METADATA") \\ || fallback "Could not read the queue metadata" \[ -n "$sha" \] || fallback "No parent batch to compare against" # The parent batch failed overall, but some of its jobs passed. List # every conclusion this job's own check run reached on that commit # (filter=all, not just the latest), scoped to this workflow's # provider. A failed lookup (missing checks:read, rate limit, deleted # commit) falls back too. checks=$(gh api "repos/$REPO/commits/$sha/check-runs?filter=all" --paginate \\ -q '.check\_runs\[\] | select(.name == env.JOB and .app.slug == "github-actions") | .conclusion') \\ || fallback "Could not read the parent batch check runs" # Skip only when this job ran there and every run of it concluded # success, so any failed attempt still forces a full run. if \[ -n "$checks" \] && ! grep -qvx success <<< "$checks"; then echo "Already passed on the parent batch ($sha), skipping this job." echo "skip=true" >> "$GITHUB\_OUTPUT" fi - name: Build if: steps.already-passed.outputs.skip != 'true' run: make build \`\`\` :::note The optimization is silent when it does not engage: a \`JOB\` name that does not match the check run, or a missing \`checks: read\` permission, just runs the full job, with no error. \`JOB\` must match the check-run name GitHub assigns exactly. Where the job has no custom \`name:\` and no matrix, \`${{ github.job }}\` is that name. The one positive sign it engaged is the \`Already passed on the parent batch\` line in the job log. ::: :::note Skipping happens inside the job, so the runner still starts before it exits early. This saves the job's work, the build or test run, not the few seconds of scheduling a runner. Where even starting a job is expensive, gate it with a lightweight planning job in \`needs:\` instead. ::: :::caution This example targets a single job through a fixed \`JOB\` value, so it does not cover matrix jobs. Each matrix leg gets its own check-run name, the job name plus the matrix values in parentheses, e.g. \`build (ubuntu-latest, 3.12)\`. A static \`JOB\` matches at most one leg, so every other leg silently runs in full. To skip matrix legs, build \`JOB\` from the \`matrix\` context so each leg matches its own check run, e.g. \`JOB: build (${{ matrix.os }}, ${{ matrix.python }})\`. ::: :::caution This optimization assumes a job that passed on the parent batch stays green on the smaller split. That holds when your jobs are independent. If a job's result depends on changes from another pull request in the batch, keep running it every time so Mergify always isolates the right culprit. ::: ## In-place checks (no batch PRs) Mergify runs checks directly on the original pull request, instead of creating temporary batch PRs, only when all of the following are true: - \`queue\_rules\[\*\].batch\_size = 1\` - \`merge\_queue.max\_parallel\_checks = 1\` - \[\`merge\_queue.mode = serial\`\](/merge-queue/queue-modes#serial-mode) - \`queue\_rules\[\*\].max\_checks\_retries = 0\`, since a \[retry\](/merge-queue/lifecycle#automatic-ci-retries) recreates the batch PR to get a fresh CI run - No two-step CI is configured (no separate \`merge\_conditions\` beyond \`queue\_conditions\`) Optionally set \`update\_bot\_account\` to avoid in-place updates blocked by GitHub for security reasons (for example, PRs from forks that modify workflows, PRs opened by other bots, or PRs that change more files than GitHub lists, where Mergify cannot rule out a workflow change). The reverse holds for ordinary PRs from forks: with \`update\_method: rebase\`, setting the account makes Mergify refuse them at queue entry. See \[Combining Merge and Update Methods\](/merge-queue/merge-strategies#combining-merge-and-update-methods). ## Skip intermediate results (anti-flake protection) Flaky tests cause intermittent batch failures that block the queue. With \`skip\_intermediate\_results: true\`, Mergify stops requiring every intermediate batch to pass: if any passing batch contains a pull request's changes, an earlier failing batch for that pull request is treated as transient and the pull request still merges. \`\`\`yaml merge\_queue: skip\_intermediate\_results: true \`\`\` This is safe because a real bug would also fail the larger batch that contains the same code; only flaky failures get bypassed. Enable it when your CI has some flakiness and you want to maximize throughput. Consider disabling it when you need every intermediate state validated for compliance, or while debugging CI and want to see all failures. :::note \`skip\_intermediate\_results\` works in serial and parallel modes. It is not supported in \[isolated mode\](/merge-queue/queue-modes#isolated-mode): batches there are fully independent, so a passing batch can't vouch for any other. ::: ## Important Considerations While using batch merging and parallel checks together can speed up your merge queue processing, consider the following points for an optimal setup: ### Branch Protection Settings The branch protection setting \*Require branches to be up to date before merging\* conflicts with a queue that tests its batches on a temporary batch pull request. GitHub enforces the setting against the original pull requests, not against the batch that was tested, so it blocks the merge. Disabling the setting is the simplest resolution, though not the only one. \[In-place checks\](#in-place-checks-no-batch-prs) build no batch pull request and never hit the conflict, but they require \`batch\_size: 1\`, so a queue that batches cannot use them. That setting is not what keeps your history linear: if your team requires a linear history, set the queue option \`merge\_method: rebase\`. See \[GitHub Rulesets Compatibility: Require Branches to Be Up to Date\](/merge-queue/github-rulesets#require-branches-to-be-up-to-date) for why the conflict happens and for every resolution. ### Queued PR Changes Remember that changes to PRs or the queue can disrupt the batch process. If a PR is updated or changed in a way that it no longer meets the \`queue\_rules\`, it will be removed from the queue, and the order of checks will be updated. In such cases, the process resets, and the remaining PRs are rechecked in their new order. --- # Unknown \--- title: "Allow to use autosquash with rebase update method" date: 2023-03-31 tags: - Workflow Automation description: "" --- Mergify now supports using \`autosquash\` when using the \`update\_method: rebase\` configuration option. That means Mergify will now rebase with the autosquash option enabled, squashing commits that have the \`fixup!\` prefix. --- # Unknown \--- title: Stacked Pull Requests description: "How the Merge Queue lands stacked pull requests: queue propagation, stack-aware batching, cascade dequeue, and partial landings." --- The Merge Queue lands stacked pull requests: chains where each pull request builds on the one below it. It recognizes two kinds of stack, and once they are in the queue it treats them the same way: a comment on the top member queues the whole chain, the members keep their order and ride in the same batch when it has room for them, and pulling one out pulls out everything above it. ## The Two Kinds of Stack They differ in how the chain is created and how the queue recognizes it. ### GitHub-Native Stacked Pull Requests GitHub has its own stacking model. You reach it with \[gh-stack\](/stacks/compare/gh-stack), its stacking extension for the \`gh\` CLI, or with \[\`mergify stack push\`\](/stacks/creating), which registers the stack with GitHub's stacking API unless you pass \[\`--no-github-native\`\](/stacks/setup#configuration). Each member is a separate branch targeting the branch below it, and GitHub itself holds the ordering, so the pull request bodies carry no marker. GitHub has no auto-merge for stacked pull requests, so without a queue each member is merged by hand as the one below it lands. Mergify must be a bypass actor with the \`exempt\` bypass mode on every GitHub ruleset that applies to the base branch. With any other bypass mode, the Merge Queue refuses the pull request. See \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets#bypass-actors) for how to set it. This requirement is specific to GitHub-native stacks. ### Mergify Stacks \[Mergify Stacks\](/stacks) are created with \`mergify stack push --no-github-native\`, which maps each commit on a single branch to its own pull request. There is no stack object on GitHub's side, so the queue recognizes the chain only when \*\*all\*\* of these hold at every step: - The PRs are physically chained: each PR's base branch is the previous PR's head branch. - Each PR carries a \`Depends-On: #N\` marker in its body, declaring its dependency on the previous PR. - Every PR's head branch lives in the repository the stack targets, not in a fork. PRs chained only by branch refs (for example, GitFlow promotion chains like \`dev\` → \`staging\` → \`prod\`) are \*\*not\*\* treated as a stack. Without the \`Depends-On:\` marker, the queue keeps each PR's literal base ref and queues them independently. The last condition is why a stack cannot be opened from a fork. The first two signals compare branch \*names\*, which only mean something inside one repository: any fork can have a branch called \`main\`, so a fork PR's head branch tells the queue nothing about where this repository's branches point. A PR opened from a fork keeps its own base ref and is queued on its own. \## Queueing a Whole Stack at Once Run \[\`@mergifyio queue\`\](/commands/queue) on the \*\*top\*\* PR of a stack and the queue command propagates synthetically to every predecessor. The whole stack enters the queue from a single comment. You don't need to comment on each PR. For a stack \`PR1 → PR2 → PR3\`, commenting \`@mergifyio queue\` on PR3 enqueues PR1, PR2, and PR3 in the right order. While PR3 waits for its predecessors to join the queue, its Summary check lists one pending \`depends-on=\` condition per predecessor, each tagged \`\[stack\]\`. That's the queue holding PR3 back until PR1 and PR2 are queued ahead of it. Propagation reaches predecessors only. Commenting on PR2 enqueues PR1 and PR2 and leaves PR3 where it is, so queue the highest member you want to land. :::tip This works the same with \[Auto-Merge\](/merge-protections/auto-merge): approve the top PR with Auto-Merge enabled and the entire stack flows into the queue as soon as \`queue\_conditions\` are met. ::: ## Stack-Aware Base Every stacked PR is queued against the \*\*stack root\*\* (e.g. \`main\`), not its immediate parent branch. Without this, PR2 would be queued against PR1's head branch and could never reach \`main\`, so the queue would have nothing to merge into. \`\`\`dot class="queue" title="Every pull request in a stack is queued against main, not against its parent branch" digraph { PR1 \[class="queued"\]; PR2 \[class="queued"\]; PR3 \[class="queued"\]; main \[label="main", class="external"\]; PR1 -> main; PR2 -> main; PR3 -> main; } \`\`\` You don't configure this. It's automatic for any PR detected as part of a stack. ## Stack-Aware Batching The queue treats a stack as an ordered chain when assembling \[batches\](/merge-queue/batches). Two guarantees hold: - \*\*Same scope group.\*\* With \[scopes\](/merge-queue/scopes) enabled, stacked PRs are consolidated into the scope group of the bottom PR, even if their individual scopes differ. The stack always travels through the same CI lane rather than getting split across unrelated lanes. - \*\*Bottom-up order.\*\* Within that group, predecessors always queue ahead of successors. PR3 is never validated before PR1 and PR2. In sequential batching, the queue actively packs a stack into the same batch when its predecessors still fit in the remaining capacity. In parallel checks, a stack longer than \`batch\_size\` (or a stack sharing its scope group with higher-priority unrelated PRs) lands across consecutive batches. Order is preserved either way. \`\`\`dot class="queue" title="Merge queue with batch\_size: 5 — the whole stack lands in one batch" digraph { subgraph cluster\_batch1 { class="batch"; label="Batch 1 — the stack kept together"; PR1 \[class="queued"\]; PR2 \[class="queued"\]; PR3 \[class="queued"\]; PR4 \[class="queued"\]; PR1 -> PR2 -> PR3 -> PR4; } PR5 \[label="…", class="queued"\]; PR4 -> PR5; } \`\`\` A PR only joins a batch if it and its still-waiting predecessors fit inside the remaining capacity. When the stack is larger than \`batch\_size\`, it lands across consecutive batches bottom-first: the first batch validates the deepest PRs that fit, and once they merge they drop out of the predecessor set, so the next batch picks up where the previous one stopped. ## Cascade Dequeue When a PR is taken out of a queued stack with \[\`@mergifyio dequeue\`\](/commands/dequeue), from the dashboard, or through the API, every successor still in the queue is dequeued with it, under the \[\`stack-predecessor-dequeued\`\](/configuration/data-types#queue-dequeue-reason) dequeue reason. This stops the queue from validating PRs whose dependency just disappeared. There's no point checking PR3 if PR1 has left the queue. \`\`\`dot class="queue" title="Cascade dequeue: dequeuing PR1 also dequeues PR2 and PR3; PR4 stays in the queue" digraph { PR1 \[label="PR1\\n(dequeued)", class="failed"\]; PR2 \[label="PR2\\n(cascaded)", class="muted"\]; PR3 \[label="PR3\\n(cascaded)", class="muted"\]; PR4 \[class="queued"\]; PR1 -> PR2 \[label="dequeue", class="failed"\]; PR2 -> PR3 \[label="dequeue", class="failed"\]; PR3 -> PR4 \[style=dashed, class="muted"\]; } \`\`\` Once the PR you pulled out is ready again, re-queue the stack from the top with \`@mergifyio queue\`. Propagation re-enqueues the predecessors as needed. :::note Cascade dequeue only affects PRs that are still \*\*queued\*\*. PRs that already merged successfully (lower in the stack) are untouched. ::: ## How a Stack Lands Members land from the bottom up. A batch that holds the whole stack lands every member of it, in order, and merged members stay in a GitHub-native stack, so that stack never shrinks. A stack can also be partly landed while the rest is still in flight: you queued only part of it, it is longer than \`batch\_size\`, or a member above the ones that merged failed. Whatever the reason, the members that already merged stay merged. ### After a Partial Landing The members still open are \*\*not rebased\*\* off the commits that just landed. For a GitHub-native stack, GitHub retargets the next member onto the stack's base branch and stops there. For Mergify Stacks, GitHub retargets the next member when the merged head branch is deleted, which is what \[automatic head-branch deletion\](/stacks/setup#3-configure-github) is for. Either way, nothing rewrites the remaining branches. So each remaining member still carries its predecessor's pre-landing commits. When the queue squashes or rebases, what landed on the base branch has new SHAs, so the member still shows that change in its diff and conflicts wherever the two touch the same lines. A member already in the queue when its predecessor landed can fail its merge for that reason; one queued afterwards is taken back out of the queue for conflicting with its base branch. With \`merge\_method: merge\` the original commits land unchanged and the remaining members merge cleanly. Rebase the remaining members before queueing them again: - \*\*Mergify Stacks\*\*: run \[\`mergify stack sync\`\](/stacks/updating#after-a-pr-merges) to drop the merged commits and rebase the rest, then \`mergify stack push\`. - \*\*GitHub-native stacks\*\*: run \`gh stack sync\`, or rebase each remaining branch on the base branch by hand. Then comment \`@mergifyio queue\` on the top member again. Propagation puts the rest of the chain back in the queue. :::tip Give \`batch\_size\` room for the stacks you usually open. When a whole stack fits in one batch and its checks pass, it lands in a single pass and nothing is left to rebase. ::: ## Limits - \*\*Maximum stack depth: 20.\*\* Stacks deeper than 20 PRs aren't recognized as a stack by the queue and fall back to per-PR queueing. - \*\*A draft predecessor holds the stack.\*\* Propagation still reaches it: the draft PR gets its own queue command, then waits on the same \`-draft\` condition as every queued PR. Nothing above it is validated until you mark it ready for review, at which point it joins the queue. You don't have to comment \`@mergifyio queue\` again. ## Related - \[Stacks\](/stacks): create and update stacks with \`mergify stack push\`. - \[\`@mergifyio queue\`\](/commands/queue): the command that triggers stack propagation. - \[Batches\](/merge-queue/batches): batch-size and CI-cost trade-offs. - \[Scopes\](/merge-queue/scopes): how stacks interact with monorepo scopes. - \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets): the \`exempt\` bypass mode GitHub-native stacks require. --- # Unknown \--- title: Using Datadog with Mergify description: Send your merge queue metrics to Datadog to build dashboards, alerts, and reports alongside the rest of your observability data. --- The Datadog integration pushes your merge queue metrics into your own Datadog account. Everything on the \[merge queue statistics page\](/merge-queue/monitoring) is available as a Datadog metric, so you can graph queue health next to your own service metrics and alert on it. The integration is official and ships as a \[Mergify tile\](https://docs.datadoghq.com/integrations/mergify\_oauth/) in Datadog's integration catalog. Mergify writes the metrics to Datadog for you. There is no agent to install and nothing to run in your CI. ## Prerequisites - A Datadog account, and permission to authorize integrations in it. - On the Mergify side, a plan that includes the Datadog integration, plus the GitHub organization \`Owner\` role or the \[\*\*Integrations Admin\*\* delegated role\](/security#delegated-roles). ## Setting up the integration 1. Install the \[Mergify tile\](https://docs.datadoghq.com/integrations/mergify\_oauth/) from Datadog's integration catalog and click \*\*Connect Accounts\*\*. The connection starts on the Datadog side, so the \*\*Connect Your Datadog Account\*\* button on the Mergify dashboard's \[\`Integrations → Datadog\`\](https://dashboard.mergify.com/integrations/datadog) page opens Datadog's catalog rather than connecting from Mergify. ![The Datadog integration in the Mergify dashboard's integrations list](https://docs.mergify.com/integrations/%7BIntegrationPageScreenshot%7D) 2. Authorize Mergify from the \[Datadog site\](https://docs.datadoghq.com/getting\_started/site/) your organization uses. Mergify supports US1, US3, US5, EU1, US1-FED, and AP1, and connects to whichever one you start from. Datadog then asks which GitHub organization to connect. Mergify creates an API key scoped to the integration and starts pushing metrics to that site. 3. Choose what to monitor. For each repository, select the merge queue \*\*base branches\*\* you want metrics for: the branches your queued pull requests target, such as \`main\` or a release branch. :::note Metrics only cover the repositories and base branches you select here. When you add a new release branch, add it to this list too, or its queue activity will be missing from Datadog. ::: ## Changing your Datadog site To switch the Datadog site your metrics go to, connect Mergify again from the site you want to move to, whether you are changing region or consolidating on a different Datadog organization. You do not need to know which site you are on today: reconnecting replaces the previous connection, whatever it was. 1. Sign in to Datadog on the site you are moving to. 2. In that account, install the \[Mergify tile\](https://docs.datadoghq.com/integrations/mergify\_oauth/) and click \*\*Connect Accounts\*\*, exactly as you did when you \[first connected\](#setting-up-the-integration). There is no other way in: Mergify has no control that starts the change, and no API or CLI equivalent. 3. Choose the same GitHub organization as before, and authorize Mergify. The site you end up on is the one you started from, so there is nothing else to pick. The Datadog permissions in \[Prerequisites\](#prerequisites) apply again here, but to the Datadog organization you are moving to; the Mergify role requirement is unchanged. Metrics start arriving on the new site at the next publication, and the old site stops receiving new points at the same moment. If you start the authorization and do not finish it, nothing changes: the previous connection stays in place until the new one completes. ### What moves with you, and what does not Your monitored repositories and their base branches are preserved. They belong to your GitHub organization rather than to the Datadog connection, so you do not have to select them again. What stays behind on the old site: - \*\*The metrics already sent there.\*\* Mergify publishes new points from the moment you reconnect; it does not copy history to the new site. - \*\*Anything you built on those metrics.\*\* Dashboards cloned from the Mergify tile and any monitors you created live in the old Datadog organization. Recreate them on the new site. - \*\*The API key Mergify created.\*\* Reconnecting creates a new key on the new site and does not revoke the old one, so delete it yourself in the old Datadog organization once the switch is done. :::note If Datadog refuses the new key because a Mergify one already exists in that account, delete that key in Datadog and reconnect: Mergify creates the key it needs on the next authorization. \[Contact support\](/support) if no points appear on the new site after a few publication cycles. ::: ## Removing the integration To stop sending metrics without disconnecting anything, remove every repository from the integration page in the Mergify dashboard. Metrics only cover the repositories you select, so an empty list stops them. The connection and the API key stay in place, ready if you add a repository back. To disconnect entirely, delete the API key Mergify created in your Datadog organization. Mergify checks that key every minute and drops the connection as soon as it stops working, so nothing is left behind on either side. This is the only route that removes both halves, and it is done from Datadog: the Mergify dashboard has no disconnect control, because deleting the connection there would leave the API key live in your Datadog account. Removing the key needs permission to manage API keys in Datadog. If that is someone else in your organization, ask them to delete it; clearing the repository list stops the metrics in the meantime. ## Metrics Every metric is published every 5 minutes, and each point covers the 5-minute window it represents. ### Tags Every metric carries these tags: | Tag | Description | | --- | --- | | \`repository\` | Full repository name, such as \`octo/hello-world\` | | \`branch\` | The base branch the queued pull requests target | | \`queue\` | Name of the \[queue rule\](/merge-queue/rules) | | \`priority\_rule\` | Name of the matching \[priority rule\](/merge-queue/priority), when set | :::caution Datadog lowercases tag values on ingestion, and collapses each run of characters outside \`a-z 0-9 \_ - : . /\` into a single underscore. Query \`outcome:success\`, not \`outcome:SUCCESS\`, and expect a queue named \`automated updates\` to arrive as \`automated\_updates\`. ::: ### Reference Metrics submitted as \*\*count\*\* are event tallies that Datadog sums exactly over any time range. Metrics submitted as \*\*gauge\*\* are peak values within the window. | Metric | Type | Description | | --- | --- | --- | | \`mergify.queue.entered\` | count | Pull requests that entered the queue | | \`mergify.queue.merged\` | count | Pull requests merged out of the queue | | \`mergify.queue.exit\_reason\` | count | Pull requests that left the queue, tagged with \`exit\_reason\` | | \`mergify.queue.size.max\` | gauge | Largest the queue got | | \`mergify.queue.running\_checks.max\` | gauge | Most checks running at once | | \`mergify.queue.check\_outcome\` | count | Finished queue checks, tagged with \`outcome\` | | \`mergify.queue.checks\_retries.recovered\` | count | Failed checks that passed on retry | | \`mergify.queue.checks\_retries.not\_recovered\` | count | Failed checks that failed again on retry | | \`mergify.queue.bisection.started\` | count | \[Batch\](/merge-queue/batches) bisections started | | \`mergify.queue.skip\_intermediate\_results.batches\_saved\` | count | Batches merged without their own checks | | \`mergify.queue.total\_queue\_time.sum\` | count | Total time queued, in seconds | | \`mergify.queue.total\_queue\_time.count\` | count | Queue sessions the sum covers | | \`mergify.queue.ci\_runtime.sum\` | count | Total CI runtime, in seconds | | \`mergify.queue.ci\_runtime.count\` | count | CI runs the sum covers | | \`mergify.queue.batch\_size.sum\` | count | Total pull requests across batches | | \`mergify.queue.batch\_size.count\` | count | Batches the sum covers | | \`mergify.queue.breakdown.ci\_runtime.sum\` | count | Queued time spent running CI, in seconds | | \`mergify.queue.idle.capacity.sum\` | count | Queued time spent waiting for capacity, in seconds | | \`mergify.queue.idle.schedule.sum\` | count | Queued time spent waiting for a schedule, in seconds | | \`mergify.queue.idle.freeze.sum\` | count | Queued time waiting on a \[freeze\](/merge-protections/freeze), in seconds | | \`mergify.queue.idle.count\` | count | Queue sessions the breakdown sums cover | Both \`outcome\` and \`exit\_reason\` are \`success\` when the pull request merged or its checks passed. Otherwise they name the reason the pull request left the queue or its checks were aborted, such as \`checks\_failed\` or \`pr\_dequeued\`. The \[integration's README\](https://github.com/DataDog/integrations-extras/blob/master/mergify\_oauth/README.md) lists every value. \`skip\_intermediate\_results.batches\_saved\` counts the batches that merged because a later batch containing their changes had already passed, so each one is a CI run the queue avoided. It only moves when \[\`skip\_intermediate\_results\`\](/merge-queue/batches#skip-intermediate-results-anti-flake-protection) is enabled on the queue. ## Querying the metrics ### Averages The duration and size metrics ship as a \`.sum\` and a \`.count\` rather than a pre-computed average, so Datadog can recompute the real average over whatever time range you graph. Divide a family's own sum by its own count: \`\`\`text sum:mergify.queue.total\_queue\_time.sum{$repository} / sum:mergify.queue.total\_queue\_time.count{$repository} \`\`\` The same shape gives you average CI runtime (\`mergify.queue.ci\_runtime.\*\`) and average batch size (\`mergify.queue.batch\_size.\*\`). :::caution Divide each family by its own \`.count\`. The \`idle.\*\` and \`breakdown.\*\` sums share the \`mergify.queue.idle.count\` denominator; \`total\_queue\_time\`, \`ci\_runtime\`, and \`batch\_size\` each have their own. Averaging a pre-averaged value, or mixing denominators, gives a number that changes with the graph's rollup interval. ::: ### Check retry recovery rate The share of failed checks that passed when retried: \`\`\`text sum:mergify.queue.checks\_retries.recovered{$repository} / (sum:mergify.queue.checks\_retries.recovered{$repository} + sum:mergify.queue.checks\_retries.not\_recovered{$repository}) \`\`\` ### Where queued time goes Total queued time splits into CI runtime plus three kinds of waiting: \`\`\`text mergify.queue.breakdown.ci\_runtime.sum # running CI mergify.queue.idle.capacity.sum # waiting for a free check slot mergify.queue.idle.schedule.sum # waiting for a schedule to open mergify.queue.idle.freeze.sum # waiting for a freeze to lift \`\`\` Graphed together as a stacked area, they show what your queue is actually waiting on. Divide any of them by \`mergify.queue.idle.count\` for a per-pull-request average. Because the three \`idle.\*\` metrics are pure waiting time, \`sum:mergify.queue.idle.\*.sum\` gives you total wasted time without counting CI. ## Dashboards and alerts ![The Mergify - Merge Queue Stats dashboard in Datadog](https://docs.mergify.com/integrations/%7BdatadogDashboardScreenshot%7D) The \[Mergify tile\](https://docs.datadoghq.com/integrations/mergify\_oauth/) ships a \*\*Mergify - Merge Queue Stats\*\* dashboard that mirrors the merge queue statistics page. In Datadog, search for \`mergify\` in your account's integration catalog, open the Mergify tile, and find the dashboard under the \*\*Monitoring Resources\*\* tab. Clone it to adapt it to your own repositories, or build your own from the metrics above. Since the metrics are ordinary Datadog metrics, you can alert on them with monitors. Useful ones to start with: - \`mergify.queue.size.max\` staying above a threshold, which usually means CI capacity is the bottleneck. - Average queued time trending up week over week. - Check retry recovery rate dropping, which points at genuinely broken tests rather than flaky ones. - \`mergify.queue.exit\_reason\` counting anything other than \`success\`, which means pull requests are leaving the queue without merging. ## Learn more - \[Monitoring your merge queue\](/merge-queue/monitoring): what each metric means and how to read it. - The \[Mergify tile\](https://docs.datadoghq.com/integrations/mergify\_oauth/) on Datadog: setup from the Datadog side and the bundled dashboard. --- # Unknown \--- title: Migrate from the github\_actions Action to GitHub Actions Events description: Step-by-step guide to replace the deprecated github\_actions action with native GitHub Actions event triggers. --- The \[\`github\_actions\` action\](/workflow/actions/github\_actions) is deprecated and will be removed in a future release. This guide walks you through triggering the same workflows from \[GitHub Actions events\](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows) instead, taking Mergify out of the dispatch path entirely. ## What Changes Today, Mergify evaluates your rule's conditions and calls GitHub's \`workflow\_dispatch\` API to start your workflow. After the migration, your workflow subscribes to the GitHub event it cares about and decides for itself whether to run. | | \`github\_actions\` action | GitHub Actions events | |---|---|---| | \*\*Who decides to run\*\* | Mergify, from \`.mergify.yml\` conditions | Your workflow, from \`on:\` filters and job \`if:\` | | \*\*How it starts\*\* | \`workflow\_dispatch\` API call | The event GitHub already emits | | \*\*Passing pull request data\*\* | \`inputs\` rendered by Mergify | The \`github.event\` payload | | \*\*Permissions needed\*\* | Mergify write permission on Actions | None beyond the workflow's own | | \*\*Limits\*\* | 10 workflows per rule, 10 inputs each | None | ## Migration Steps ### 1. Turn the rule's conditions into an event trigger Find the rule that dispatches your workflow and read its conditions. Most map directly onto an \`on:\` filter, a job-level \`if:\`, or both: | Mergify condition | Event trigger | Job condition | |---|---|---| | \`merged\` | \`pull\_request\` / \`types: \[closed\]\` | \`github.event.pull\_request.merged == true\` | | \`closed\` and \`-merged\` | \`pull\_request\` / \`types: \[closed\]\` | \`github.event.pull\_request.merged == false\` | | \`label=deploy\` | \`pull\_request\` | \`contains(github.event.pull\_request.labels.\*.name, 'deploy')\` | | \`base=main\` | \`pull\_request\` / \`branches: \[main\]\` | None | | \`author=octocat\` | \`pull\_request\` | \`github.event.pull\_request.user.login == 'octocat'\` | | \`-draft\` | \`pull\_request\` / add \`ready\_for\_review\` to \`types:\` | \`github.event.pull\_request.draft == false\` | | \`files~=^src/\` | \`pull\_request\` / \`paths: \['src/\*\*'\]\` | None | Four of these need care. \`paths:\` takes glob patterns, not the regular expressions \`files~=\` accepts, so \`^src/\` becomes \`src/\*\*\`. The \`-draft\` row needs an explicit \`types:\` because \`ready\_for\_review\` is not one of the defaults, which are \`opened\`, \`synchronize\` and \`reopened\`. Listing all four is what makes the workflow fire when someone clicks "Ready for review". Without it that click emits no run at all, and no job condition can compensate for a run that was never created. The \`label=deploy\` row reads the label off the pull request rather than off the event, using \`contains(...labels.\*.name...)\`. The alternative, \`github.event.label.name\`, exists only on the \`labeled\` activity type and is null everywhere else. That matters as soon as you combine rows: a rule conditioned on both \`merged\` and \`label=deploy\` needs \`types: \[closed\]\` from the first row, where \`github.event.label\` does not exist. Reading the label off \`github.event.pull\_request\` composes with every activity type. Rows are otherwise composable by intersecting the \`types:\` and ANDing the job conditions, as long as every expression you AND is valid for the activity types you kept. Conditions that Mergify computes itself, such as check results or review counts, have no equivalent trigger. \[Step 3\](#3-re-express-the-conditions-that-have-no-event) covers those. ### 2. Replace the workflow inputs with the event payload Every variable the \`github\_actions\` action could render is already in the event payload: | Input variable | GitHub Actions expression | |---|---| | \`{{ author }}\` | \`github.event.pull\_request.user.login\` | | \`{{ number }}\` | \`github.event.pull\_request.number\` | | \`{{ title }}\` | \`github.event.pull\_request.title\` | | \`{{ base }}\` | \`github.event.pull\_request.base.ref\` | | \`{{ head }}\` | \`github.event.pull\_request.head.ref\` | | \`{{ repository\_full\_name }}\` | \`github.repository\` | Read these expressions directly wherever the workflow used \`inputs.\`. These expressions come from the \`pull\_request\` object, which the \`pull\_request\`, \`pull\_request\_target\` and \`pull\_request\_review\` payloads all carry. The events in \[step 3\](#3-re-express-the-conditions-that-have-no-event) do not: \`workflow\_run\`, \`check\_suite\` and \`status\` have no \`pull\_request\` object, so \`github.event.pull\_request.number\` resolves to an empty string there rather than failing. Under those triggers, look the pull request up through the API instead. Remove the \`workflow\_dispatch\` trigger only once nothing else dispatches the workflow. Another Mergify rule, a \`gh workflow run\` command or the "Run workflow" button in the Actions tab all depend on it, and dispatching a workflow that no longer declares the trigger fails. ### 3. Re-express the conditions that have no event Conditions that Mergify computes have no GitHub event that fires when they become true. Check results and review counts can be re-expressed by subscribing to the closest event and evaluating the state in the job. Conditions with no observable event at all, such as \`conflict\` or any queue-state attribute, are covered at the end of this step. For \`check-success\`, when the check comes from a workflow in the same repository, use \`workflow\_run\`: \`\`\`yaml on: workflow\_run: workflows: \[CI\] types: \[completed\] permissions: contents: read jobs: deploy: if: >- github.event.workflow\_run.conclusion == 'success' && github.event.workflow\_run.head\_branch == 'main' && github.event.workflow\_run.head\_repository.full\_name == github.repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - run: ./deploy.sh \`\`\` Three details make this snippet longer than it looks like it should be. \`workflows:\` matches the other workflow's \`name:\`, not its filename and not the check name. This is the one place the mapping from \`check-success\` is not direct: \`check-success\` takes the name GitHub reports for the check, which for GitHub Actions is the \*\*job\*\* name. A rule reading \`check-success=build\`, where \`build\` is a job inside a workflow named \`CI\`, becomes \`workflows: \[CI\]\`. GitHub only starts a \`workflow\_run\` workflow whose file is on the repository's default branch, and the run itself executes against the default branch: \`GITHUB\_REF\` and \`GITHUB\_SHA\` point there, not at the commit the CI run validated. The bare \`actions/checkout\` above therefore gets the default branch. To act on the validated commit, pin \`ref: ${{ github.event.workflow\_run.head\_sha }}\`, and read GitHub's \[guidance on script injection\](https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks) first. The \`if:\` guards the branch and the head repository because \`workflow\_run\` runs in the base repository's context with its secrets and a read/write token, and it fires for CI runs on pull requests from forks too. Without those guards, a green CI run on an unreviewed fork pull request would run \`./deploy.sh\` with your credentials. For checks reported by a third-party CI, use the \[\`check\_suite\`\](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#check\_suite) or \[\`status\`\](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#status) event instead. Both carry the same default-branch requirement as \`workflow\_run\`: a workflow file on a feature branch never receives them, so it cannot be tested before it merges. For review conditions, let GitHub compute the answer rather than counting reviews yourself, since \`reviewDecision\` already accounts for dismissed and superseded reviews: \`\`\`yaml on: pull\_request\_review: types: \[submitted\] permissions: contents: read pull-requests: read jobs: deploy: runs-on: ubuntu-latest steps: - name: Read the review decision id: review env: GH\_REPO: ${{ github.repository }} GH\_TOKEN: ${{ secrets.GITHUB\_TOKEN }} run: | decision=$(gh pr view "${{ github.event.pull\_request.number }}" \\ --json reviewDecision --jq .reviewDecision) echo "decision=$decision" >> "$GITHUB\_OUTPUT" - if: steps.review.outputs.decision == 'APPROVED' uses: actions/checkout@v5 - if: steps.review.outputs.decision == 'APPROVED' run: ./deploy.sh \`\`\` The job reads the decision into an output and skips the remaining steps instead of failing on anything other than an approval. A \`run: ... || exit 1\` gate would turn every \`COMMENTED\` review, every \`CHANGES\_REQUESTED\` review and every approval before the last required one into a failed run, leaving a red check-run on the pull request until the final approval lands. The \`permissions:\` block is required: \`gh pr view\` reads \`reviewDecision\` through the GraphQL API, which a default token restricted to \`contents: read\` cannot query. \`reviewDecision\` reflects the approval count your branch protection or ruleset requires, and is empty when no rule requires a review at all, so this step only works on a branch that has one. For a threshold that differs from it, or for a branch with no review requirement, list the reviews through \[the reviews API\](https://docs.github.com/en/rest/pulls/reviews#list-reviews-for-a-pull-request) and count them yourself. \`pull\_request\_review\` carries the same fork restriction as \`pull\_request\`, and there is no \`pull\_request\_review\_target\` to swap in. On a pull request from a fork this job gets no repository secrets, so gate deployments that need them on the merge instead. Some conditions have no event and no reliable state to poll. \`conflict\` is one: GitHub computes mergeability asynchronously, so \`github.event.pull\_request.mergeable\` is null on the first delivery and a job gated on it flaps. Queue-state attributes such as \`queue-position\` are another, since they describe Mergify's own state and are not visible to GitHub at all. A rule that depends on these is not a candidate for this migration. Move the workflow's trigger to something observable, or keep the rule until the workflow no longer needs that condition. ### 4. Remove the rule from your Mergify configuration Before deleting anything, walk through \[Behavior Differences to Check\](#behavior-differences-to-check): a workflow started by an event does not always run in the same context as a dispatched one. Once the workflow triggers on its own, delete the \`github\_actions\` action from \`.mergify.yml\`. If the rule existed only to dispatch, delete the whole rule. Mergify's write permission on Actions is part of the Mergify GitHub App and is not granted per action, so there is nothing to revoke once the rule is gone. ## Complete Before & After Example A rule that transitions a Jira issue and posts to Slack once a pull request is merged into \`main\`. \*\*Before:\*\* a Mergify rule dispatching two workflows. \`\`\`yaml pull\_request\_rules: - name: Run post-merge automation conditions: - merged - base=main actions: github\_actions: workflow: dispatch: - workflow: jira-transition.yaml inputs: pull\_request: "{{ number }}" author: "{{ author }}" - workflow: slack-notify.yaml inputs: title: "{{ title }}" \`\`\` \*\*After:\*\* each workflow triggering on the merge itself. \`\`\`yaml # .github/workflows/jira-transition.yaml name: Jira transition on: pull\_request: types: \[closed\] branches: \[main\] jobs: transition: if: github.event.pull\_request.merged == true runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - run: ./scripts/jira-transition.sh env: JIRA\_TOKEN: ${{ secrets.JIRA\_TOKEN }} PULL\_REQUEST: ${{ github.event.pull\_request.number }} AUTHOR: ${{ github.event.pull\_request.user.login }} \`\`\` \`\`\`yaml # .github/workflows/slack-notify.yaml name: Slack notification on: pull\_request: types: \[closed\] branches: \[main\] jobs: notify: if: github.event.pull\_request.merged == true runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - run: ./scripts/slack-notify.sh env: SLACK\_WEBHOOK: ${{ secrets.SLACK\_WEBHOOK }} TITLE: ${{ github.event.pull\_request.title }} \`\`\` The Mergify rule disappears: both workflows now react to the same merge Mergify was watching for. ## Behavior Differences to Check Four differences catch people out. Check each against your own workflows before deleting the rule. \*\*Secrets on pull requests from forks.\*\* Mergify dispatched your workflow with the repository's own credentials, so secrets were always available. A workflow triggered by \`pull\_request\` from a fork gets a read-only \`GITHUB\_TOKEN\` and no secrets, so a step that posts to Slack or calls Jira will now fail. This holds for every activity type, \`closed\` included, and for \`pull\_request\_review\` as well. When your repository takes pull requests from forks, swap \`pull\_request\` for \[\`pull\_request\_target\`\](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull\_request\_target) and keep the same \`types:\` and \`branches:\` filters: it carries the same payload and runs with the repository's secrets. Two caveats. It runs with full permissions and must never check out the pull request's code. And its workflow file is read from the base repository's \*\*default\*\* branch, not from the pull request's base branch, so adding it only to a release branch produces no runs at all. \*\*Which version of the workflow file runs.\*\* A \`pull\_request\` run uses the workflow file from the pull request's merge commit, so a contributor's changes to the workflow take effect on their own pull request. Dispatches ran your repository's default branch instead, or the branch named by the rule's \`ref\` option. A rule that set \`ref\` was pinning both the workflow and the code it runs to a vetted branch, and no event trigger reproduces that: switch such a workflow to \`on: push\` against that branch, or check out the pinned ref explicitly rather than relying on the event's own. \*\*How often it fires.\*\* A Mergify rule matches while its conditions hold; an event fires each time it happens. A workflow on \`types: \[labeled\]\` runs again on every subsequent label. Add a \[\`concurrency\`\](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#concurrency) group when repeated runs would collide. \*\*Where failures show up.\*\* A failed dispatch surfaced in the Mergify check-run on the pull request. Once migrated, failures appear in the Actions tab and in the workflow's own check-run instead. --- # Unknown \--- title: "Open draft PR if no bot account is set and rebase is used" date: 2023-03-15 tags: - Merge Queue description: "" --- In certain cases, Mergify now opens a draft pull request to merge pull request from the merge queue when the update method is set to \`rebase\` and no bot account is being used. --- # Unknown \--- title: "Support Merge-After condition in PR body" date: 2023-04-19 tags: - Workflow Automation description: "" --- A new \`Merge-After\` field is now recognized by Mergify. When this field is used in a pull request body, the \`merge\` and \`queue\` action will only be triggered after the timestamp listed in the \`Merge-After\` value. --- # Unknown \--- title: Using Queue Rules description: Learn how to implement queue rules and route your pull requests. --- \*\*Mergify's multiple queue rules\*\* give you finer control over the merge process by categorizing pull requests based on any criteria you define. Queue rules let you organize your PR merge process into separate templates, each with its own merge configuration. With queue rules, you can: - Define multiple queues for different categories of PRs (e.g. dependencies vs. features). - Control merge methods (merge, squash, rebase, fast-forward, merge-batch) per queue. - Adjust batching behavior (batch size, max wait time). - Apply custom conditions for queuing and merging (labels, branch targets, CI checks, file paths, etc.). ## Configuring Queue Rules Multiple queue rules are defined under the \`queue\_rules\` key in your configuration file. Each rule needs a unique \`name\` and can have different configurations. \`\`\`yaml queue\_rules: - name: urgent # Can be queued early if the PR has the urgent label queue\_conditions: - label = urgent # Still requires CI to pass before merge merge\_conditions: - check-success = myci - name: default # Requires CI both for queueing and merging queue\_conditions: - check-success = myci \`\`\` ## Configuration Options The top-level key \`queue\_rules\` allows you to define the rules that govern your \[merge queue\](/merge-queue). Here are all the available fields you can configure for a queue rule: | Key name | Value type | Default | Description | Status | | --- | --- | --- | --- | --- | | \`allow\_inplace\_checks\` | boolean | \`true\` | Deprecated: this value is computed automatically. In-place checks are enabled only when: - \`max\_parallel\_checks == 1\` - every queue has \`batch\_size == 1\` - every queue CI is single-step (no extra \`merge\_conditions\`; either empty or identical to \`queue\_conditions\`) | deprecated | | \`allow\_queue\_branch\_edit\` | boolean | \`false\` | Deprecated: this option is being removed after 2026-12-31, and there is no replacement. Move the work now done on a batch branch onto the pull requests themselves. Once the option is gone, an edited batch branch dequeues the pull requests it carries and reports the edit as a failure, which is the behaviour you get today by leaving this unset. When creating a branch for a queue, if the commits of this branch are edited by an entity external to Mergify, Mergify dequeues all pull requests embarked in the branch and report the issue as a failure. If set to \`true\`, Mergify will allow such modifications and trust the content of the branch. Make sure only Mergify and your external application are allowed to edit these branches. This option requires \`merge\_method\` to be \`merge-batch\` or \`fast-forward\`. Those two merge the batch branch itself, so a commit pushed to it is part of what lands on the base branch; \`merge\`, \`squash\` and \`rebase\` merge each pull request at its own head, which never includes the edit. Enabling it therefore means the merged content is the batch branch, including commits that were never reviewed as part of any pull request. That is the contract of this option: it exists for batch-level work (a conflict resolution, a migration reorder, a lockfile regeneration) that belongs to no single pull request. Note also that under these two merge methods Mergify does not merge the pull requests one by one: GitHub marks each embarked pull request as merged only when its head commit is reachable from the new base branch tip, so a pull request whose head no longer matches what was embarked is not shown as merged even though its content landed. | | | \`autoqueue\` | boolean | \`false\` | When set to true, automatically add a pull request to the queue when it matches the queue conditions. When false, the pull request must be manually queued. Deprecated: use merge\_protection\_settings.auto\_merge\_conditions instead. | deprecated | | \`batch\_max\_failure\_resolution\_attempts\` | integer or null | \`null\` | The number of attempts to resolve a batch failure before dequeueing pull requests. By default, Mergify will attempt to resolve a batch failure by splitting the batch multiple times until it finds the root cause of the failure. You can stop this process earlier by limiting the number of resolution attempts. Setting this to 0 will dequeue all the pull requests from a batch when a batch fails. | | | \`batch\_max\_wait\_time\` | duration | \`"30 seconds"\` | The maximum amount of time to wait for additional pull requests before processing a batch that hasn't reached \`batch\_size\`. The timer starts when the first pull request enters the batch. If \`batch\_size\` is reached before this time expires, the batch processes immediately. This does not enforce a minimum delay between batches. | | | \`batch\_size\` | integer or \`{min, max}\` | \`1\` | The number of pull requests per speculative check in the queue. Either a single integer (fixed size, 1-128) or an object \`{min, max}\` for dynamic batching: the queue uses \`min\` when parallel-check slots are plentiful and grows toward \`max\` to keep the backlog at zero. | | | \`branch\_protection\_injection\_mode\` | \`queue\` or \`merge\` or \`none\` | \`"queue"\` | Branch protections conditions injection mode to use. - \`queue\` will inject branch protections conditions as required conditions for queuing and merging pull requests. - \`merge\` will inject branch protections conditions as required conditions only for merging pull requests. - \`none\` will not inject them at all, and requires a \`merge\_bot\_account\` able to satisfy the protections itself. | | | \`checks\_timeout\` | duration or \`auto\` or null | \`"auto"\` | The amount of time the merge queue waits for pending checks to return before dequeueing pull requests. This cannot be less than 60 seconds. Defaults to \`auto\`, which lets Mergify compute the timeout from the recent CI runtime of this queue (the 95th-percentile runtime with a safety margin). Runs identified as retry reruns or bisection runs are excluded from the calibration; runs whose provenance predates this tracking are kept for compatibility. \`auto\` applies no timeout until enough history has been gathered. Set to \`null\` to disable the checks timeout entirely. | | | \`commit\_message\_format\` | CommitMessageFormatModel or null | \`null\` | Declarative commit message format configuration. Use this instead of the Jinja2 \`commit\_message\_template\` for the common merge-commit shapes. Mutually exclusive with \`commit\_message\_template\` on the same rule. | | | \`commit\_message\_template\` | template or null | \`null\` | Template to use as the commit message when using the merge or squash merge method. Deprecated: use \`commit\_message\_format\` instead. | deprecated | | \`conflict\_resolvers\` | list of ConflictResolverModel | | Resolve conflicts on the files you name while Mergify builds a batch, instead of removing the pull request that conflicts from it. When several entries match a file, the last one wins. Only takes effect when the batch branch Mergify built is what lands: \`merge\_method\` set to \`merge-batch\` or \`fast-forward\`, or \`queue\_branch\_merge\_method\` set to \`fast-forward\`. Otherwise \`merge\`, \`squash\` and \`rebase\` merge each pull request on its own, so a resolution made while building the batch would never land. | | | \`draft\_bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to create its draft pull requests. If no \`draft\_bot\_account\` is set, Mergify creates the draft pull request itself. The user account must have already been logged in Mergify dashboard once and have admin, write or maintain permission. | | | \`max\_checks\_retries\` | integer | \`0\` | Number of times Mergify will retry failed CI checks before removing the pull request from the queue. On each retry, the draft pull request is recreated to trigger a fresh CI run. This is useful for handling flaky CI. When set to a value greater than 0, in-place checks are disabled and a draft pull request is always created. Set to 0 (default) to disable retries. | | | \`merge\_bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to merge pull requests. If no \`merge\_bot\_account\` is set, Mergify merges the pull request itself. The user account \*\*must\*\* have already been logged in Mergify dashboard once and have \*\*write\*\* or \*\*maintain\*\* permission. | | | \`merge\_conditions\` | List of conditions | | The list of conditions to match to get the queued pull request merged. In case of draft pull request, the merge conditions for checks are evaluated against the temporary pull request instead of the original one. | | | \`merge\_method\` | \`merge\` or \`rebase\` or \`squash\` or \`fast-forward\` or \`merge-batch\` or null | \`null\` | Merge method to use. If no value is set, Mergify uses the first authorized method available in the repository configuration. Additionally, \`merge-batch\` merges the draft pull request prepared by the merge queue using a merge commit. This requires \`batch\_size > 1\`. | | | \`name\` | string | | Name of the queue rule. | | | \`queue\_branch\_merge\_method\` | \`fast-forward\` or null | \`null\` | Deprecated spelling of \`merge\_method: fast-forward\`. If set to \`fast-forward\`, Mergify moves the base branch onto the draft pull request instead of merging the original pull request that has been checked, whatever \`merge\_method\` is set to. Use \`merge\_method: fast-forward\` instead. | deprecated | | \`queue\_branch\_prefix\` | string | \`"mergify/merge-queue/"\` | Prefix for the merge queue branch name. It must start valid git branch names, and cannot start with \`refs/\`, which GitHub refuses. Branches under this prefix are eligible for automatic \[queue branch cleanup\](https://docs.mergify.com/merge-queue/lifecycle#queue-branch-cleanup). | | | \`queue\_conditions\` | List of conditions | | The list of conditions that needs to match to queue the pull request. | | | \`update\_bot\_account\` | simple-template or null | \`null\` | For certain actions, such as rebasing branches, Mergify has to impersonate a GitHub user. You can specify the account to use with this option. With no \`update\_bot\_account\`, the update goes through GitHub's API as Mergify and impersonates nobody. The user account \*\*must\*\* have already been logged in Mergify dashboard once. This option overrides the value defined in the queue rules section of the configuration. \*\*Warning:\*\* With \`update\_method: rebase\` and checks run in place, a pull request coming from a fork cannot be rebased on behalf of this account: GitHub refuses an OAuth token on its rebase API for a fork, so it would mean impersonating the account to force-push the contributor's branch. Those pull requests are refused when they are queued. Unset this option to rebase them through GitHub's API as Mergify instead -- except for a fork pull request that changes GitHub Actions workflows or was opened by another App's bot, which GitHub lets Mergify queue in place only \*with\* an \`update\_bot\_account\`, or that changes more files than GitHub lists, which Mergify cannot rule out as a workflow change; such a queue has to run its checks on a draft pull request. Or set \`update\_method: merge\` on a queue that does not merge with \`fast-forward\`: such a queue lands by moving the base branch onto this one, so a merge commit is what it exists to keep off it, and it has to run its checks on a draft pull request instead. | | | \`update\_method\` | \`rebase\` or \`merge\` or null | \`null\` | Method to use to update the pull request with its base branch when the check is done in place. Possible values: - \`merge\` to merge the base branch into the pull request. - \`rebase\` to rebase the pull request against its base branch. When the queue runs its checks in place, a pull request coming from a fork cannot be rebased on behalf of an \`update\_bot\_account\` and is refused -- see that option for the remedy. Without an \`update\_bot\_account\`, the rebase goes through GitHub's API as Mergify, which works on a fork -- except for one that changes GitHub Actions workflows or was opened by another App's bot, which GitHub lets Mergify queue in place only \*with\* an \`update\_bot\_account\`, or one that changes more files than GitHub lists, which Mergify cannot rule out as a workflow change. Such a queue has to run its checks on a draft pull request instead. When \`null\`, defaults to \`merge\` except if \`merge\_method\` is \`fast-forward\` then it defaults to \`rebase\`. | | ## Merge Method The \`merge\_method\` option controls how pull requests are merged into the base branch. Accepted values are \`merge\`, \`rebase\`, \`squash\`, \`fast-forward\`, and \`merge-batch\`. Each method produces a different git history shape. See the \[Merge Strategies\](/merge-queue/merge-strategies) guide for a detailed comparison, including configuration examples and trade-offs. :::note The \`fast-forward\` method advances the base branch ref directly to the tested commit(s) instead of creating a merge via GitHub. It works with both single PRs and batches. See \[Merge Strategies: Fast-Forward\](/merge-queue/merge-strategies#fast-forward) for details on inplace and batch-PR modes. ::: :::note The \`merge-batch\` method merges the batch pull request prepared by the merge queue directly into the base branch using a merge commit. It requires \`batch\_size > 1\`. See \[Merge Strategies: Merge Batch\](/merge-queue/merge-strategies#merge-batch) for details. ::: ## Queue vs. Merge Conditions - \*\*\`queue\_conditions\`\*\* → Requirements for a PR to be \*accepted into the queue\*. Example: a label, a CI check, or a branch filter. - \*\*\`merge\_conditions\`\*\* → Requirements for a PR to be \*merged once it reaches the front of the queue\*. Example: all CI checks passed, required approvals. This separation lets you schedule PRs early (e.g. based on labels) while still enforcing stricter checks before merge. This can be used to implement \[two-step CI\](/merge-queue/two-step). You can find more details about the \[lifecycle of a pull request in the documentation\](/merge-queue/lifecycle#lifecycle-of-a-pull-request-in-the-merge-queue). ## Auto‑Queueing Pull Requests :::caution \`autoqueue\` is deprecated. Use \[\`auto\_merge\_conditions\`\](/merge-protections/auto-merge) in \`merge\_protections\_settings\` instead. Mergify opens an automatic migration pull request that rewrites the configuration: uniform \`autoqueue: true\` becomes \`auto\_merge\_conditions: true\`, while mixed configurations inline the autoqueued queues' \`queue\_conditions\` into \`auto\_merge\_conditions\`. See \[Migrating from \`autoqueue\`\](/merge-protections/auto-merge#migrating-from-autoqueue) for the full translation rules. \[Merge Protections\](/merge-protections/setup) must be enabled for \`auto\_merge\_conditions\` to take effect. \`auto\_merge\_conditions\` and \`autoqueue\` cannot coexist; Mergify raises a configuration error if both are present. ::: Control auto-queueing with \[\`auto\_merge\_conditions\`\](/merge-protections/auto-merge) in \`merge\_protections\_settings\`. It accepts \`true\` for unconditional auto-merge, or a list of conditions to restrict the audience. --- # Unknown \--- title: "Merge Queue Pause" date: 2023-06-27 tags: - Merge Queue description: "" --- The merge queue is now pauseable. This means it is nos possible to stop processing the merge queue altogether and stop scheduling new checks. This is exposed \[through the API\](https://docs.mergify.com/api/#/operations/create\_queue\_pause\_repos\_\_owner\_\_\_repository\_\_queue\_pause\_put) at \`/repos/{owner}/{repository}/queue/pause\`. --- # Unknown \--- title: "New statistics API" date: 2022-11-22 tags: - API - Merge Queue description: "" --- Mergify now exposes a \[statistics API\](https://docs.mergify.com/api/#/operations/get\_average\_time\_to\_merge\_stats\_endpoint\_repos\_\_owner\_\_\_repository\_\_queues\_\_queue\_name\_\_stats\_time\_to\_merge\_get) that allows to retrieve various metrics about queues: - time to merge - check duration - failure by reason - queue checks outcome --- # Unknown \--- title: "Support unspecified digits for current-datetime attribute" date: 2023-08-04 tags: - Rules description: "" --- The \`current-datetime\` attribute now supports unspecified digits in the form of \`XXXX-01-01 12:12:00\`. --- # Unknown \--- title: "Move \`require\_branch\_protection\` config option to \`queue\_rules\`" date: 2023-07-27 tags: - Merge Queue description: "" --- The \`require\_branch\_protection\` configuration option has been moved to the \`queue\_rules\` section. --- # Unknown \--- title: "Add added/modified/removed-files attributes" date: 2023-08-09 tags: - Rules description: "" --- This changes added three new attributes \`added-files\`, \`modified-files\` and \`removed-files\`. --- # Unknown \--- title: "Add condition queue-dequeue-reason" date: 2023-09-01 tags: - Merge Queue - Rules description: "" --- Mergify now exposes a new \`queue-dequeue-reason\` which contains the code for the reason a PR has been dequeued. This allows to write more automation around the merge queue. --- # Unknown \--- title: "Add \`branch\_protection\_injection\_mode\` to bypass branch protections" date: 2023-09-06 tags: - Merge Queue description: "" --- A new setting for the merge queue \`branch\_protectin\_injection\_mode\` has been adde, that will now allow to select which mode of injection we use for branch protections throughout our merge queue process. You can now inject them for queuing, merging, both, or even disable the injection to bypass branch protections. --- # Unknown \--- title: "Add unqueue reasons for conflicts" date: 2023-09-11 tags: - Merge Queue description: "" --- Mergify now exposes more reason for removing a pull request from a queue by adding support for conflict cases. --- # Unknown \--- title: "Rename queue action \`method\` option in \`merge\_method\`" date: 2023-07-07 tags: - Merge Queue description: "" --- The \`method\` option has been renamed to \`merge\_method\` in the \`queue\` action. --- # Unknown \--- title: "Add an endpoint with stats average runtime" date: 2023-12-21 tags: - API - Merge Queue description: "" --- The API now exposes a stats endpoint to retrieve the average runtime of CI. --- # Unknown \--- title: "Drop \`require\_branch\_protection\` option" date: 2023-11-22 tags: - Merge Queue description: "" --- This is now replaced by \`branch\_protection\_injection\_mode\`. See \[queue rules documentation.\](https://docs.mergify.com/configuration/file-format/#queue-rules) For example: - \`require\_branch\_protection: false\` must be replaced by \`branch\_protection\_injection\_mode: merge \` - \`require\_branch\_protection: true\` must be replaced by \`branch\_protection\_injection\_mode: queue \` --- # Unknown \--- title: "New endpoint queues merged count by time intervals" date: 2023-12-11 tags: - API - Merge Queue description: "" --- We added a new API endpoint to retrieve the number of merged PR stats. --- # Unknown \--- title: "Expose queue-frozen and queue-freeze-reason attribute" date: 2023-12-21 tags: - Rules description: "" --- Mergify now exposes the \`queue-frozen\` and \`queue-freeze-reason\` attribute to be used in conditions and templates. This allows to know if a pull request is in a queue that is frozen and the reason for the freeze. --- # Unknown \--- title: "Stats endpoints for the number of running checks" date: 2024-01-23 tags: - API - Merge Queue description: "New statistics endpoint exposes the number of concurrent running checks." --- \[A new statistics endpoint is available\](https://docs.mergify.com/api/#tag/statistics/get/repos/%7Bowner%7D/%7Brepository%7D/stats/running\_speculative\_checks) and exposes the number of concurrent running checks. --- # Unknown \--- title: "Add mergify-configuration-changed condition" date: 2024-01-16 tags: - Rules description: "New boolean condition \`mergify-configuration-changed\` is true when a pull request modifies the Mergify configuration." --- A new Boolean condition named \`mergify-configuration-changed\` has been added. It is true when a pull request changes the Mergify configuration. --- # Unknown \--- title: "Remove queue action 'priority' attribute" date: 2023-05-15 tags: - Merge Queue description: "" --- The \`priority\` attribute of the queue action \[has been deprecated\](https://changelog.mergify.com/changelog/priority-option-for-queue-is-deprecated) in favor of \`priority\_rules\`. --- # Unknown \--- title: "Add new queue\_checks\_outcome endpoint that includes all partitions and queues" date: 2023-05-11 tags: - API - Merge Queue description: "" --- The API \[offers a new endpoint\](https://docs.mergify.com/api/#/operations/get\_queue\_checks\_outcome\_stats\_for\_all\_queues\_and\_partitions\_endpoint\_repos\_\_owner\_\_\_repository\_\_stats\_queue\_checks\_outcome\_get) that expose the checks outcome for all partitions and queues in a repository. --- # Unknown \--- title: "Add new endpoint for queue checks outcome" date: 2024-01-24 tags: - API - Merge Queue description: "New API endpoint exposes statistics on queue checks outcome, replacing the previous endpoint." --- \[A new API endpoint for getting stats on queue checks outcome is available.\](https://docs.mergify.com/api/#tag/statistics/get/repos/%7Bowner%7D/%7Brepository%7D/stats/queue\_checks\_outcome) It will replace the previously existing endpoint. --- # Unknown \--- title: "Add co-authors attribute" date: 2023-07-06 tags: - Rules description: "" --- The \`co-authors\` attributes is now exposed in the conditions and templating system. This allows to access the list of a pull request co-authors and write action or templates using this information. --- # Unknown \--- title: Agent Skills description: Install the Mergify Agent Skills in Claude Code, Codex, or any skills.sh agent, so your coding agent can drive the Mergify CLI for you. --- Mergify ships Agent Skills that teach an AI coding agent how to use the Mergify CLI: how to read the merge queue, how to find out why a pull request was dequeued, what belongs in a \`.mergify.yml\`, how to push a stack. They live in the \[\`Mergifyio/mergify-cli\`\](https://github.com/Mergifyio/mergify-cli) repository under \`skills/\`, are Apache-2.0, and ship as one bundle. \[Install\](#install) it in Claude Code, in Codex, or in any agent skills.sh supports. :::caution The skills drive the \`mergify\` command. They are instructions for using the CLI, not a standalone API client, so an agent that cannot run a shell cannot use them. Install and authenticate the CLI first (see the \[CLI installation guide\](/cli/usage)), or every skill fails on its first command. ::: ## What the bundle contains - \*\*\`mergify-merge-queue\`\*\* queues and dequeues pull requests, reads queue status, works out why a pull request left the queue and which check failed, and pauses or resumes merging. See \[Merge Queue\](/merge-queue). - \*\*\`mergify-events\`\*\* reads the \[Activity Log\](/api/activity-log) for one pull request or for a whole repository, and reconstructs a pull request's queue lifecycle. - \*\*\`mergify-config\`\*\* validates a \`.mergify.yml\` against the schema, and simulates what your rules would do on a real pull request. See \[Configuration File\](/configuration/file-format). - \*\*\`mergify-merge-protections\`\*\* sets up pull request dependencies, delayed merges, and \[scheduled freezes\](/merge-protections/freeze). - \*\*\`mergify-ci\`\*\* uploads JUnit test results, detects git refs, and sets \[Merge Queue Scopes\](/merge-queue/scopes). See \[CI Insights\](/ci-insights). - \*\*\`mergify-stack\`\*\* turns a branch of commits into \[a stack of pull requests\](/stacks) and keeps them rebased. ## Before you install Every skill shells out to \`mergify\`, so two things have to be true before any of them is useful: 1. The CLI is installed and on the agent's \`PATH\`. On macOS, \`brew install mergifyio/tap/mergify-cli\`. For Linux, Windows, and CI runners, see the \[CLI installation guide\](/cli/usage). 2. It is authenticated. See \[Authentication\](#authentication) below. These skills only work in a terminal agent that can run the binary, such as Claude Code, Codex, or Cursor. A browser-only chat cannot run it, so the skills do nothing there. ## Install The bundle is the same whichever way you install it. Pick the path for your agent: | Agent | Install from | |---|---| | Claude Code | \[Its built-in plugin marketplace\](#claude-code) | | Codex | \[The OpenAI plugin directory\](#codex), or \[skills.sh\](#cursor-cline-copilot-and-other-skillssh-agents) | | Cursor, Cline, Copilot, and others | \[skills.sh\](#cursor-cline-copilot-and-other-skillssh-agents) | ### Claude Code Inside Claude Code, enter: \`\`\`text /plugin install mergify@claude-plugins-official \`\`\` The \`claude-plugins-official\` marketplace ships with Claude Code, so there is nothing to add first. You can also run \`/plugin\` on its own, open \*\*Discover\*\*, and search for \`mergify\`. ### Codex Inside Codex, enter: \`\`\`text /plugins \`\`\` That opens the plugin directory. Search it for Mergify, install the \[Mergify listing\](https://chatgpt.com/plugins/plugins\_6aabe2c8f7b88191a6962623c8199c7b), then start a new Codex session so the skills load. Codex and ChatGPT share one plugin directory, but the listing currently only works from Codex: the skills shell out to \`mergify\`, which ChatGPT itself cannot run. Codex is also a skills.sh agent, so the command in the next section works for it too, if you would rather install every agent the same way. ### Cursor, Cline, Copilot, and other skills.sh agents In your terminal, from the project you want the skills in, run: \`\`\`bash npx skills add Mergifyio/mergify-cli \`\`\` \[skills.sh\](https://skills.sh) installs the same bundle into Cursor, Cline, Copilot, Codex, and dozens of other agents. It detects the agent it is running under and writes the skills where that agent looks for them. To pick the target yourself, or to install once for every project instead of only the current one: \`\`\`bash npx skills add Mergifyio/mergify-cli --agent cursor --global \`\`\` Check the result with \`npx skills list\`. ## Authentication Most of what the skills do goes through the Mergify API. Sign in once and every skill inherits the credential: \`\`\`bash mergify auth login \`\`\` That stores a \[Mergify user token\](/api/usage#using-a-mergify-user-token) outside the agent's reach, so no secret has to go on a command line or into the project. Where the operating system has no credential store, which is the usual case in a container, the CLI writes a restricted file in your configuration directory instead. See \[Authentication\](/cli/usage#authentication) for both paths. \`mergify auth login\` opens the approval page in your browser. On a machine without one, pass \`--no-browser\` and open the URL it prints on another machine. Stacks is the exception. It creates and updates pull requests through the GitHub API, so it needs a GitHub token of its own. Install the \[GitHub CLI\](https://cli.github.com/), run \`gh auth login\`, and Stacks commands pick up its token on their own. :::caution Letting the CLI authenticate to the Mergify API with a GitHub token is deprecated. \`GITHUB\_TOKEN\` and the \`gh auth token\` fallback still work, and the CLI warns when it uses one, but run \`mergify auth login\` instead. Stacks is unaffected: it needs a GitHub token either way. ::: \*\*A Mergify application key\*\* is the alternative when the agent runs unattended and cannot complete an interactive sign-in. Create one from your \[dashboard\](https://dashboard.mergify.com) and export it, so the agent does not have to put a secret on a command line: \`\`\`bash export MERGIFY\_TOKEN=your\_token\_here \`\`\` An \`admin\` key covers queue status, the Activity Log, freezes, and browsing or quarantining tests; CI and test result uploads, Merge Queue Scopes, and the mid-run flaky-detection and test-selection reads need a \`ci\` key instead. No single key covers both, so pick the one that matches what you want the agent to do. An application key does not work for Stacks. An unattended agent that pushes stacks needs a GitHub token, which is not deprecated: the deprecation above is only about using a GitHub token to reach the Mergify API. Exporting \`GITHUB\_TOKEN\` is not enough on its own, though. Stacks commands read \`--token\`, then \`MERGIFY\_TOKEN\`, then \`GITHUB\_TOKEN\`, so an agent that already has an application key in \`MERGIFY\_TOKEN\` hands that key to GitHub and the push fails. Pass the GitHub token as \`--token\` on the Stacks commands, or keep the application key out of \`MERGIFY\_TOKEN\`. See \[GitHub token for Stacks\](/cli/usage#github-token-for-stacks) for the full resolution order. Application keys come with either the \`admin\` scope or the \`ci\` scope, and neither is read-only. \`admin\` covers the API except CI and test result uploads, Merge Queue Scopes, and the mid-run flaky-detection and test-selection reads, all of which need a \`ci\` key, so one key does not cover every command either. A key also belongs to a GitHub account rather than to a single repository, so it reaches every repository that account can see. Read \[Application Key Scopes\](/api/usage#application-key-scopes) before you hand one to an agent. ## Try it With the CLI installed and the skills in place, ask for what you want in plain language: - "Why did pull request #1234 leave the merge queue?" - "Validate this .mergify.yml, then show me what it would do on #1234." - "Freeze the queue until Monday morning." - "Turn these four commits into a stack and push it." The agent picks the skill that matches and runs the CLI itself. :::tip Want to hand your agent a single URL instead? Point it at \[docs.mergify.com/stacks/agents\](/stacks/agents), a page written for the agent to read, which walks it through installing the CLI and setting up Stacks on its own. ::: --- # Unknown \--- title: CI Insights description: Optimize your CI run time, catch flaky tests, and give developers actionable insights so your team ships code faster. hubAccent: true --- CI Insights helps you monitor your pipelines, detect flaky tests and jobs, and improve your CI efficiency. This guide walks you through enabling CI Insights via GitHub and covers basic configuration steps. :::note To start collecting data, install the Mergify GitHub App on a repository with existing CI, then check the \*\*CI Insights\*\* box for that repository on the \[Repositories page\](/integrations/github#configuring-enabled-products) and confirm with \*\*Save Changes\*\*. Installing the app is not enough on its own: products are enabled one repository at a time, and until CI Insights is enabled on a repository, Mergify records no CI data for it. Job data then arrives on the next CI run. Test-level data needs your test framework to upload its results as well. See \[Test Framework Configuration\](#test-framework-configuration) below. ::: ## Understanding CI Insights ### Components Monitor your self-hosted runners' capacity, performance, cost, and reliability. Monitor job health, duration, cost, and flaky behavior. Automatically retry failed CI jobs caused by flaky tests or transient failures. \### Flaky Detection CI Insights flags a \*\*flaky job\*\* when the same job, in the same pipeline, runs more than once on the same commit (SHA1) and the runs end with different conclusions, even though the code did not change. Cancelled runs are ignored, since a cancellation says nothing about the code. A \*\*flaky test\*\* comes from the same kind of disagreement, either between repeated runs of one commit or between a pass and a failure recorded within the same hour on the same branch, pipeline, and job. A failure has to be part of the disagreement, so a test that is skipped in one run and passes in another stays healthy. To set up systematic flaky test detection in your CI pipeline, see our dedicated \[Flaky Test Detection guide\](/ci-insights/flaky-test-detection). ## CI Setup Guides Select your CI system below to enable CI Insights and configure flaky test detection. Enable CI Insights & flaky test detection for Buildkite. Enable CI Insights & flaky test detection for GitHub Actions. Enable CI Insights & flaky test detection for Jenkins. \## Test Framework Configuration To capture test-level data from your CI pipeline, configure your test framework to upload results to Mergify. See the \[Test Insights test framework guides\](/test-insights#test-framework-configuration) for framework-specific setup instructions. --- # Unknown \--- title: "Add time\_to\_merge endpoint that has data of all partitions and queues" date: 2023-05-11 tags: - API - Merge Queue description: "" --- The API now offers \[a new endpoint\](https://docs.mergify.com/api/#/operations/get\_time\_to\_merge\_stats\_for\_all\_queues\_and\_partitions\_endpoint\_repos\_\_owner\_\_\_repository\_\_stats\_time\_to\_merge\_get) that returns the \`time\_to\_merge\` statistics for all the partitions and queues in the repository. --- # Unknown \--- title: Mergify Refresh Command description: Refresh Mergify status of a pull request. --- The \`refresh\` command is used to manually trigger Mergify to reevaluate a pull request's conditions. It's particularly useful if you've updated your Mergify configuration and want to apply the new rules to existing pull requests without waiting for a new event to naturally trigger the reevaluation. ## Syntax To use the \`refresh\` command, comment on the pull request with: \`\`\`text @mergifyio refresh \`\`\` Mergify will then reevaluate the pull request based on your latest configuration and rules. --- # Unknown \--- title: "API endpoint for average/min/max queue size" date: 2024-01-04 tags: - API - Merge Queue description: "New API endpoint exposes the average, minimum, and maximum size of your merge queues over recent weeks." --- The API now exposes a new endpoint to get the average, minimum and maximum size of the merge queues over the last weeks. --- # Unknown \--- title: "New API stats endpoint for average idle queue time" date: 2023-12-22 tags: - API - Merge Queue description: "" --- The API now exposes a new endpoint that returns the idle time spent in queue by the pull requests by intervals of time. --- # Unknown \--- title: "Add copy/backport action \\"report\_mode\\" option" date: 2024-02-29 tags: - Workflow Automation description: "New \`report\_mode\` parameter lets you report \`copy\` and \`backport\` results as a GitHub check or as a comment." --- The \`copy\` and \`backport\` action now support a new \`report\_mode\` parameter which allows to configure how the action is reported. The default is \`check\`, which reports the action result in a GitHub check. The \`comment\` value allows to rather post a comment on the pull request with the result of the action. --- # Unknown \--- title: "Copy/backport actions post comment with cherry-pick error" date: 2024-02-27 tags: - Workflow Automation description: "When \`copy\` or \`backport\` fails to cherry-pick, Mergify now posts the error as a comment on the target pull request." --- When a \`copy\` or \`backport\` action fails to execute and creates a pull request, it will also post a comment in the target pull request with the cherry-pick error. --- # Unknown \--- title: "Add merge-commit-sha attribute" date: 2024-05-14 tags: - Rules description: "New \`merge-commit-sha\` attribute exposes a pull request's merge commit SHA1 in rules and templates." --- A new attribute \`merge-commit-sha\` has been added for being used in rules and templates, allowing to use the SHA1 of a merge commit from a pull request. --- # Unknown \--- title: "Priority\_rules is now at the top level of the Mergify config" date: 2024-08-26 tags: - Merge Queue description: "\`priority\_rules\` is now a top-level option, with priorities applied globally across the merge queue." --- The \`priority\_rules\` configuration option has been moved from the \`queue\_rules\` definition to be a top-level option in the Mergify configuration file. While the format is kept the same, the priority are now global to the whole merge queue and not defined by queue rule. --- # Unknown \--- title: "Allow to have \`queue\_rule\` in \`defaults\` section" date: 2024-09-06 tags: - Merge Queue description: "Set defaults for queue rules — including \`bot\_account\` and \`batch\_size\` — via the \`defaults\` section, including across extended configurations." --- It is now possible to set default configuration for \`queue\_rules\` using the \`defaults\` section of the configuration. This allows to set default configuration such as \`bot\_account\` or \`batch\_size\` for all queues. This is also supported when extending the configuration across multiple repositories. --- # Unknown \--- title: "Check interruption disabled by default for priority rules" date: 2026-04-21 tags: - Merge Queue description: "The default for \`allow\_checks\_interruption\` in priority rules changes from true to false, so higher-priority pull requests no longer interrupt running checks unless explicitly configured." --- Previously, when a higher-priority pull request entered the merge queue, it would automatically interrupt ongoing checks of lower-priority pull requests. This is now disabled by default. To keep the previous behavior, set \`allow\_checks\_interruption: true\` explicitly on your priority rules. Affected configurations will receive an automated migration pull request. --- # Unknown \--- title: "New \`updates\` attribute available for conditions" date: 2024-11-21 tags: - Rules description: "New \`updates\` attribute exposes the list of updates pushed to a pull request's branch, usable in conditions." --- A new \`updates\` field is now exposed through pull requests attributes and can be used in conditions. It contains the list of updates that has been pushed in the pull request branches. --- # Unknown \--- title: "Slack integration" date: 2024-11-14 tags: - Integrations description: "Mergify integrates natively with Slack — send your merge queue activity to any channel." --- Mergify now integrates with Slack natively. You can receive the activity from your Merge Queue directly in your favorite Slack channel. --- # Unknown \--- title: "Add merge queue total queue time" date: 2024-03-06 tags: - API - Merge Queue description: "New API endpoint exposes the total queue time for pull requests, also surfaced in the dashboard statistics." --- The API now exposes an endpoint with the total queue time for pull requests. This is also exposed in the dashboard statistics. --- # Unknown \--- title: "Pull request scopes API is now public" date: 2026-04-21 tags: - API description: "The endpoint to set scopes on pull requests is now available in the public API." --- You can now use the public API to set scopes on pull requests via \`POST /v1/repos/{owner}/{repository}/pulls/{number}/scopes\`. This endpoint was previously internal-only and is now documented in the public OpenAPI specification, making it accessible to CI application key holders for programmatic scope management. --- # Unknown \--- title: "Unified \\"Mergify Merge Queue\\" check run" date: 2026-04-21 tags: - Merge Queue description: "A single \\"Mergify Merge Queue\\" check run on pull requests, providing a unified view of merge queue status." --- Every pull request in a repository with merge queue enabled now displays a "Mergify Merge Queue" check run. This check consolidates queue status information (whether the PR is queued, waiting for conditions, or has been dequeued) into a single, consistent check. --- # Unknown \--- title: "Restrict auto-merge to specific pull requests with \`auto\_merge\_conditions\`" date: 2026-05-06 tags: - Merge Protections description: "Configure which pull requests are eligible for auto-merge using a list of conditions instead of a global on/off toggle." --- \`merge\_protection\_settings.auto\_merge\_conditions\` accepts \`true\` for unconditional auto-merge, or a list of conditions to restrict auto-merge to a subset of pull requests — for example \`\[author = dependabot\[bot\]\]\` to auto-merge bot PRs while letting humans queue manually, or \`\[label = ready-to-merge\]\` to require an explicit opt-in label. When the conditions match, the pull request is added to the merge queue (or merged directly if no merge queue is configured) once your merge protections pass. --- # Unknown \--- title: "Mergify Terraform provider" date: 2026-05-05 tags: - Integrations description: "Manage Mergify product enablement declaratively with Terraform" --- The official \[Mergify Terraform provider \](https://registry.terraform.io/providers/Mergifyio/mergify/latest)is now available on the Terraform Registry. You can now manage Mergify configuration alongside the rest of your infrastructure-as-code, with two resources to start: - \`mergify\_repository\_products\` — set the products enabled on a GitHub repository (\`merge\_queue\`, \`merge\_protections\`, \`ci\_insights\`, \`workflow\_automation\`). - \`mergify\_organization\_default\_products\` — set the products enabled by default on new repositories of an organization. \`\`\`hcl terraform { required\_providers { mergify = { source = "Mergifyio/mergify" version = "~> 0.1" } } } resource "mergify\_repository\_products" "monorepo" { owner = "Mergifyio" repository = "monorepo" products = \["merge\_queue", "merge\_protections", "ci\_insights"\] } \`\`\` Authentication uses a Mergify application key or a GitHub personal access token, read from the \`token\` provider attribute or the \`MERGIFY\_TOKEN\` / \`GITHUB\_TOKEN\` environment variables. --- # Unknown \--- title: "Auto-group queued pull requests by changed files" date: 2026-06-02 tags: - Merge Queue description: "Mergify now batches queued pull requests that touch similar files together automatically, with no scopes, CI action, or API setup." --- Mergify now groups queued pull requests by the directories they change, read straight from each pull request's diff. This kicks in whenever reported scopes don't already separate the pull requests, for example when no scopes source is configured and every pull request shares the same empty scopes. Related changes are batched together automatically, with no scopes, CI action, or API setup. Where reported scopes already differ, they keep driving the grouping; the changed directories only decide when scopes don't. --- # Unknown \--- title: "Delegate Mergify admin powers to non-GitHub Owners" date: 2026-05-06 tags: description: "GitHub Owners can now delegate specific Mergify admin powers to individual users without granting them GitHub Owner rights." --- A new Roles tab in Settings lets GitHub Owners delegate Mergify admin powers to individual users without making them GitHub Owners. Each user can hold any combination of four roles: Billing Admin (subscription and billing), CI Admin (CI Insights configuration and \`ci\`-scoped application keys), Default Product Action Admin (GitHub integrations and product enablement), and Delegation Admin (managing the roster itself). This is useful when a finance teammate needs billing access but shouldn't run merges, or when a CI engineer needs to tune fleet settings without becoming a GitHub Owner. --- # Unknown \--- title: "Honor GitHub ruleset required reviewers" date: 2026-06-02 tags: - Merge Protections description: "Mergify now waits for the team and user approvals required by GitHub rulesets before merging." --- When a GitHub repository ruleset requires reviews from specific teams or users, Mergify now waits for those approvals before merging. The new \`github-require-review-from-specific-teams\` condition is auto-injected when the engine detects the requirement, and you can reference it explicitly in your \`.mergify.yml\`. File-scoped requirements (the ruleset's \`file\_patterns\` field) are honored, so a per-directory team approval only kicks in for PRs that touch matching files. --- # Unknown \--- title: Migrate to Mergify description: Guides to migrate from popular tools and bots to Mergify. --- Thinking about switching? Pick your current tool below to see how to migrate to Mergify with minimal friction. Move from Bulldozer's automerge to Mergify rules and Merge Queue. Replace Bors queues and try/staging flows with Mergify Merge Queue. Replace GitHub Merge Queue with automation, batching & observability. Don't see your tool? \[Tell us\](mailto:support@mergify.com) which one to add next. --- # Unknown \--- title: "Scheduled freezes support in Slack" date: 2025-01-31 tags: - Integrations - Merge Protections description: "Send scheduled freeze creation, update, and deletion events from Merge Protections directly to a Slack channel." --- Scheduled freezes events from Merge Protections are now supported in Slack. You can send creation, update and deletion events directly into your favorite Slack channel. --- # Unknown \--- title: "New statistics page visuals" date: 2025-11-06 tags: - Merge Queue description: "We upgraded the looks of the statistics page, including better charts and tooltips visuals." --- We upgraded the looks of the statistics page, including better charts and tooltips visuals. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic2a3f2b37c5da8015bbaed82ec3042a4apng%7D) --- # Unknown \--- title: Post Check (Deprecated) description: Create a check-run on a pull request. Deprecated in favor of Merge Protections. --- :::danger The \`post\_check\` action is \*\*deprecated\*\* and will be removed in a future release. Use \[Merge Protections\](/merge-protections) instead. Mergify will automatically migrate your configuration by removing \`post\_check\` rules and opening a migration pull request that converts them to equivalent merge protections. ::: ## Migrating to Merge Protections \[Merge Protections\](/merge-protections) replace \`post\_check\` by letting you define \`success\_conditions\` directly, without creating an intermediate check-run. ### Before (post\_check) \`\`\`yaml pull\_request\_rules: - name: Check CI status conditions: - base=main actions: post\_check: success\_conditions: - check-success=ci/test neutral\_conditions: - check-neutral=ci/lint title: "Mergify check: {{ check\_rule\_name }}" summary: | {{ check\_conditions }} \`\`\` ### After (Merge Protections) \`\`\`yaml merge\_protections: - name: Check CI status if: - base=main success\_conditions: - or: - check-success=ci/test - check-neutral=ci/lint \`\`\` :::note The \`title\` and \`summary\` options have no equivalent in Merge Protections and will be dropped during the automatic migration. ::: :::note When both \`success\_conditions\` and \`neutral\_conditions\` are defined, the migration wraps them in a single \`or\`, as above. When only one of the two is defined, its conditions are copied across as-is. When neither is defined, the \`post\_check\` action is removed without a replacement merge protection. ::: --- ## Legacy Reference The \`post\_check\` action allows Mergify to create a check-run on a pull request. This can be useful in situations where you want to add a custom check to the status of a pull request based on Mergify's evaluation. ![A post_check check-run in a GitHub pull request's checks list, flagging a title that breaks Conventional Commit](https://docs.mergify.com/workflow/actions/%7BPostCheckScreenshot%7D) ### Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`neutral\_conditions\` | List of conditions or null | \`null\` | List of conditions to match to mark the pull request check as neutral, otherwise, it will be marked as failing. | | \`success\_conditions\` | List of conditions or null | \`null\` | List of conditions to match to mark the pull request check as succeeded, otherwise, it will be marked as failing. If unset, the conditions from the rule that triggers this action are used. | | \`summary\` | template | \`"{{ check\_conditions }}"\` | The summary of the check. | | \`title\` | template | \`"'{{ check\_rule\_name }}'{% if check\_status == 'success' %} succeeded{% elif check\_status == 'failure' %} failed{% endif %}"\` | The title of the check. | As the \`title\` and \`summary\` are \[templates\](/configuration/data-types#legacy-template), you can benefit from any \[pull request attributes\](/configuration/conditions#attributes-list), e.g. \`{{author}}\`, and also these additional variables: - \`{{ check\_rule\_name }}\` the name of the rule that triggered this action; - \`{{ check\_status }}\` the resulting check-run status: \`success\` when the \`success\_conditions\` match, \`neutral\` when the \`neutral\_conditions\` match, and \`failure\` otherwise. When neither option is set, the triggering rule's own conditions decide between \`success\` and \`failure\`; - \`{{ check\_succeeded }}\` is \`true\` if \`check\_status\` is \`success\`, \`false\` otherwise; - \`{{ check\_conditions }}\` the \`success\_conditions\` with a checkbox marked against each one that matches. It is empty when only \`neutral\_conditions\` is set, and falls back to the triggering rule's own conditions when neither option is set. \`{{ check\_succeed }}\` is also available as an alias of \`{{ check\_succeeded }}\`, kept for backward compatibility. --- # Unknown \--- title: Delete Head Branch (Deprecated) description: Delete pull request head branch. Deprecated in favor of GitHub's built-in "Automatically delete head branches" setting. --- :::danger The \`delete\_head\_branch\` action is \*\*deprecated\*\* and will be removed in a future release. Use GitHub's built-in \[automatically delete head branches\]\[gh-auto-delete\] setting instead. ::: The \`delete\_head\_branch\` action allows Mergify to automatically delete the head branch of a pull request once that pull request is closed, whether it was merged or not. This can be useful for maintaining a clean repository and reducing clutter from unused branches. Add a \[\`merged\`\](/configuration/conditions#attributes-list) condition to your rule if you only want merged pull requests to have their branch deleted. A head branch that lives on a fork is never deleted. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`force\` | boolean | \`false\` | If set to \`true\`, the branch will be deleted even if another pull request depends on the head branch. GitHub will therefore close the dependent pull requests. | ## Branches Mergify Refuses to Delete Mergify does nothing on a pull request coming from a fork, since the head branch is not yours to delete. Unless \`force\` is set, it also refuses to delete a branch that other pull requests still use, and GitHub refuses to delete a protected branch or the repository's default branch. The author of a pull request picks its head branch, so a rule whose \[conditions\](/configuration/conditions) describe only the state of a pull request deletes whichever branch that person named as the head. That leaves long-lived unprotected branches exposed, such as a staging or a release branch. A condition on the \[author\](/configuration/conditions#attributes-list) or on a \`label\`, or a pattern on \`head\`, keeps the rule off them. ## Examples Here is an example of how the \`delete\_head\_branch\` action can be used in your workflow: \`\`\`yaml pull\_request\_rules: - name: delete head branch after merge if the label "cleanup" is present conditions: - merged - label = cleanup actions: delete\_head\_branch: \`\`\` In this example, Mergify will automatically delete the head branch of a pull request once it has been merged, but only if the pull request has been labeled with "cleanup". \[gh-auto-delete\]: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches --- # Unknown \--- title: Queue description: Add the pull request to the merge queue. --- The \`queue\` action allows you to put a pull request into the \[merge queue\](/merge-queue). By placing pull requests in the queue, you can make sure they are up-to-date and control their processing based on their priority. If you have enabled \[\`auto\_merge\_conditions\`\](/merge-protections/auto-merge) in \`merge\_protections\_settings\`, matching pull requests are added automatically and you usually do not need this action. Use the action when you want explicit, rule-driven or conditional enqueueing beyond what \`queue\_conditions\` express. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`name\` | string or null | \`null\` | The name of the queue rule where the pull request should be added. If no name is set, queue\_conditions will be applied instead. | ## Examples \`\`\`yaml pull\_request\_rules: - name: put PRs in queue conditions: - label = queue-me actions: queue: \`\`\` In this example, any pull request that has the label \`queue-me\` will be automatically queued. The pull request still needs to match the \`queue\_conditions\` defined in the queue to enter the queue. :::note By default, Mergify injects your GitHub branch protections and ruleset rules as queue conditions. If some ruleset rules are incompatible with your queue setup, see \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets) for resolution steps. ::: --- # Unknown \--- title: Rebase description: Rebase the pull request on top of its base branch. --- The \`rebase\` action makes Mergify rebase the pull request on top of its base branch. This is useful when you want to ensure that your pull request is always up-to-date with the latest changes from the base branch. :::note You do not need to use this action if you use the \[merge queue\](/merge-queue). The merge queue automatically updates the pull requests it processes as necessary, making sure they are tested with up-to-date code before being merged. ::: :::caution This action does not rebase a pull request opened from a fork. It always rebases as a GitHub user, and GitHub refuses an OAuth token on its rebase API for a fork, so doing it would mean impersonating that user to force-push the contributor's branch. The action reports that the pull request was opened from a fork and cannot be rebased, and does nothing, whether or not \[\`bot\_account\`\](/configuration/data-types#bot-account) is set. Use the \[\`update\` action\](/workflow/actions/update) on those instead: it merges the base branch into the pull request, and impersonates nobody unless you set its own \`bot\_account\`. It only acts when the pull request is behind its base branch, so a branch that needs a linear history has to be rebased by its author. ::: ## Rebase Requirements Whatever your conditions are, Mergify adds its own requirements before running the action. A pull request is rebased only when it is open, has no conflict, is not in a merge queue (\[\`queue-position = -1\`\](/configuration/conditions#attributes-list)), and is either behind its base branch (\`#commits-behind > 0\`) or does not have a linear history (\`-linear-history\`). A pull request opened from another repository whose head branch Mergify cannot write at all, such as one whose fork has been deleted, is refused for that reason rather than the one above, and the check run says so. \[The \`update\` action\](/workflow/actions/update#fork-pull-requests) covers those cases, which refuse \`update\` too. ## Impersonation Rebasing always acts as a GitHub user. With no \`bot\_account\` set, that user is the pull request author, or whoever posted the \[\`@mergifyio rebase\` command\](/commands/rebase) when a command triggered the rebase. The account must have signed in to the \[Mergify dashboard\](https://dashboard.mergify.com) at least once. That account cannot be a bot: Mergify cannot impersonate an account owned by another GitHub App. The action fails whenever the account it falls back to is one, whether a GitHub App opened the pull request, such as a dependency update bot, or posted the command. Set \`bot\_account\` to a user account to rebase those. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`bot\_account\` | simple-template or null | \`null\` | To rebase, Mergify needs to impersonate a GitHub user. You can specify the account to use with this option. If no \`bot\_account\` is set, Mergify picks the pull request author, or the user who sent the \`@mergifyio rebase\` command. The user account must have already been logged in Mergify dashboard once. \*\*Warning:\*\* Because of GitHub's security restrictions, Mergify cannot impersonate an account owned by another GitHub App. A rebase therefore fails whenever the account it falls back to is a bot, either because the pull request was opened by one or because one sent the command, unless \`bot\_account\` names a user account. \*\*Warning:\*\* A pull request coming from a fork cannot be rebased, whether or not this option is set: rebasing one means impersonating a GitHub user to force-push the contributor's branch. Use the \`update\` action or the \`@mergifyio update\` command on those -- except where Mergify cannot write the head branch at all, such as a deleted fork, where \`update\` is refused too and the check run says what is wrong. | ## Examples ### Rebase on Label Rebase a pull request when it gets the \`ready-to-merge\` label. \`\`\`yaml pull\_request\_rules: - name: rebase when ready to merge conditions: - label = ready-to-merge actions: rebase: \`\`\` --- # Unknown \--- title: Merge description: Automate the merging of your pull requests. --- The \`merge\` action allows Mergify to automatically merge pull requests when certain conditions are met. This reduces the need for manual intervention. Whatever your conditions are, Mergify might inject extra conditions for the merge action to take place: - Mergify never merges a pull request that is a draft, closed, or in conflict - Mergify always respects the \[branch protection settings\](#branch-protection-conditions) - Mergify always respects your \[Merge Protections\](/merge-protections), when they are enabled on the repository - Mergify always respects \[pull request dependencies\](#pull-request-dependencies) - Mergify always respects the \[merge date\](#merge-date) - Mergify merges pull requests that modify its own configuration file, but only once its \[configuration check\](/configuration/file-format#validation) has passed, so a broken configuration is never merged - With \`method: fast-forward\`, Mergify also waits for the pull request to be up to date with its base branch (\`#commits-behind = 0\`), since a fast-forward merge cannot move the base branch otherwise :::note A \[scheduled freeze\](/merge-protections/freeze) decides the \`Mergify Merge Protections\` check only when the \[merge queue\](/merge-queue) is disabled. When the merge queue is enabled, the freeze is reported in that check but enforced by the queue itself, so the check can pass while a freeze is running and the \`merge\` action goes ahead. Queue the pull request with the \[\`queue\` action\](/workflow/actions/queue) instead if you want the freeze to hold it back. ::: ## Branch Protection Conditions Mergify automatically reads your GitHub branch protections and rulesets and injects them as merge conditions. For example, a rule requiring an approved review injects the \[\`github-review-approved\`\](/configuration/conditions#github-rulesets-and-branch-protection-attributes) condition. That condition reproduces GitHub's own review decision rather than counting approvals, so an active "Request changes" from a reviewer other than the approver keeps it unsatisfied. ![Mergify Branch Protection Condition Injection](https://docs.mergify.com/workflow/actions/%7BbranchProtectionConditionsScreenshot%7D) For details on how injection works, which ruleset rules are compatible, known incompatibilities, and how to configure bypass actors, see \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets). ## Pull Request Dependencies You can specify dependencies between pull requests from the same repository, or from another repository that has Mergify installed and belongs to the same repository owner, whether that owner is a user or an organization. Mergify waits for the linked pull requests to be merged before merging any pull request with a \`Depends-On:\` header. A reference Mergify cannot resolve blocks the merge rather than waiting on it, and it stays blocked until you fix the reference. That includes a reference pointing at another owner's repository, at a repository without Mergify, or at a pull request that does not exist. To use this feature, add the \`Depends-On:\` header to the body of your pull request: \`\`\`text New awesome feature 🎉 To get the full picture, you may need to look at these pull requests: Depends-On: #42 Depends-On: https://github.com/organization/repository/pull/123 Depends-On: https://github.com/organization/other-repository/pull/456 Depends-On: organization/test-repository#789 \`\`\` In this example, the pull request will only be merged when the pull request #42, #123, #456 from \`other-repository\` and #789 from \`test-repository\` are merged. :::caution If the dependency happens between pull requests targeting different branches, the evaluation of the dependent will not be automatic. You might need to use the \[refresh\](/commands/refresh) command to make Mergify realize the dependency has been merged. ::: ## Merge Date You can specify a date after which you want a pull request to be merged with a \`Merge-After:\` header. Mergify will wait for the date and time to be passed before merging your pull request. To use this feature, add the \`Merge-After:\` header to the body of your pull request, followed by the date in the \[timestamp format\](/configuration/data-types#timestamp). For example, if a pull request body contains: \`\`\`text Merge-After: 2023-04-18 18:20 \`\`\` The pull request will only be merged after April, 18th 2023 at 18:20 UTC, if all other merge conditions are satisfied. ## Parameters | Key name | Value type | Default | Description | Status | | --- | --- | --- | --- | --- | | \`commit\_message\_format\` | CommitMessageFormatModel or null | \`null\` | Declarative commit message format configuration. Use this instead of the Jinja2 \`commit\_message\_template\` for the common merge-commit shapes. Mutually exclusive with \`commit\_message\_template\` on the same rule. | | | \`commit\_message\_template\` | template or null | \`null\` | Template to use as the commit message when using the merge or squash merge method. Deprecated: use \`commit\_message\_format\` instead. | deprecated | | \`merge\_bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to merge pull requests. If no \`merge\_bot\_account\` is set, Mergify merges the pull request itself. The user account \*\*must\*\* have already been logged in Mergify dashboard once and have \*\*write\*\* or \*\*maintain\*\* permission. | | | \`method\` | \`merge\` or \`rebase\` or \`squash\` or \`fast-forward\` or null | \`null\` | Merge method to use. If no value is set, Mergify uses the first authorized method available in the repository configuration. | | ## Examples ### Automatic Merge In this example, Mergify will automatically merge (using the squash method) any pull request that has passed its CI checks and has at least 2 approved reviews. \`\`\`yaml pull\_request\_rules: - name: automatic merge when CI checks pass and at least 2 approved reviews conditions: - check-success = test - "#approved-reviews-by >= 2" actions: merge: method: squash \`\`\` ### Customizing the Commit Message When merging with the \`merge\` or \`squash\` method, the \`commit\_message\_format\` setting controls the title, body, and trailers of the resulting commit: \`\`\`yaml commit\_message\_format: title: inherit # inherit | pr-title (default: inherit) body: inherit # inherit | pr-body | empty (default: inherit) trailers: \[\] # subset of \[co-authored-by, approved-by, merged-by\] \`\`\` \`commit\_message\_format\` is accepted under \`queue\_rules\`, \`actions.merge\`, and \`defaults\`. Omit it to let your repository's GitHub settings render the entire commit. #### Title - \`inherit\` (default): Mergify does not send a title; your repository settings render it. - \`pr-title\`: use the pull request title with the PR number appended: \`{title} (#{number})\`. #### Body - \`inherit\` (default): Mergify does not send a body; your repository settings render it. - \`pr-body\`: use the pull request description. - \`empty\`: produce an empty body. Useful when you only want trailers. #### Trailers \`trailers\` is an ordered list. Mergify appends one trailer block to the commit body, separated by a blank line: | Value | Source | Format | | ----- | ------ | ------ | | \`co-authored-by\` | PR commit authors, deduplicated by email | \`Co-authored-by: \` | | \`approved-by\` | Approving reviewers | \`Approved-by: \` | | \`merged-by\` | Mergify identity | \`Merged-by: Mergify \` | All three follow the canonical kernel-style \`Name \` shape and are parseable by \`git interpret-trailers\`. \`Co-authored-by\` continues to render as a co-author badge in the GitHub UI. #### Validation - \`commit\_message\_format\` and \`commit\_message\_template\` cannot be set on the same rule. - \`body: inherit\` cannot be combined with non-empty \`trailers\`, because Mergify must not override the body to append trailers. :::caution When \`body\` is set to \`pr-body\` or \`empty\`, Mergify always sends a body to GitHub's merge API. This overrides your repository's \`squash\_merge\_commit\_message\` and \`merge\_commit\_message\` settings for the affected merges. ::: #### Sample Configurations GitHub-style commit, with the pull request title in the subject and the pull request description as the body: \`\`\`yaml pull\_request\_rules: - name: automatic merge when CI checks pass and at least 2 approved reviews conditions: - check-success = test - "#approved-reviews-by >= 2" actions: merge: method: squash commit\_message\_format: title: pr-title body: pr-body \`\`\` Merging a pull request titled "Fix some bug" with the description "This fixes some bug I found while testing the app." produces: \`\`\`text Fix some bug (#123) This fixes some bug I found while testing the app. \`\`\` The remaining variants show only the \`commit\_message\_format\` block; nest it under \`actions.merge\`, \`queue\_rules\[\]\`, or \`defaults\`. Title only, no body content: \`\`\`yaml commit\_message\_format: title: pr-title body: empty \`\`\` Pull request description plus an \`Approved-by:\` trailer block: \`\`\`yaml commit\_message\_format: title: pr-title body: pr-body trailers: - approved-by \`\`\` resulting in: \`\`\`text Fix some bug (#123) This fixes some bug I found while testing the app. Approved-by: jdoe <12345+jdoe@users.noreply.github.com> Approved-by: jsmith <67890+jsmith@users.noreply.github.com> \`\`\` Trailer-only commit, useful when you want every merge to carry a \`Merged-by:\` line and nothing else: \`\`\`yaml commit\_message\_format: title: pr-title body: empty trailers: - merged-by \`\`\` ### Migrating from \`commit\_message\_template\` The legacy \`commit\_message\_template\` setting is a \[template\](/configuration/data-types#legacy-template) that renders the entire commit message. \`commit\_message\_format\` covers the common patterns declaratively, with predictable output and no template engine. Most existing templates map directly: | \`commit\_message\_template\` | \`commit\_message\_format\` equivalent | | ------------------------- | ---------------------------------- | | \`{{ title }} (#{{ number }})\\n\\n{{ body }}\` | \`title: pr-title\`, \`body: pr-body\` | | \`{{ title }} (#{{ number }})\` | \`title: pr-title\`, \`body: empty\` | | \`{{ title }}\\n\\n{{ body }}\` | \`title: inherit\`, \`body: pr-body\` | | \`Merge pull request #N from owner/branch\` (the GitHub default) | omit \`commit\_message\_format\` entirely | For example, this template that appends an \`Approved-by:\` line per reviewer: \`\`\`yaml commit\_message\_template: | {{ title }} (#{{ number }}) {{ body }} {% for user in approved\_reviews\_by %} Approved-by: {{ user }} {% endfor %} \`\`\` becomes: \`\`\`yaml commit\_message\_format: title: pr-title body: pr-body trailers: - approved-by \`\`\` --- # Unknown \--- title: Edit description: Convert a pull request to or from a draft. --- The \`edit\` action lets Mergify change a pull request's draft state. This is helpful when you want to automatically convert a pull request to or from a draft based on its conditions. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to edit a pull request. If no \`bot\_account\` is set, Mergify will edit the pull request itself. | | \`draft\` | boolean or null | \`null\` | If the pull request should be a draft (true) or the other way around (false). | ## Examples ### Converting a Pull Request to a Draft on Check Failure If any of your continuous integration checks fail, it might be worth converting the pull request to a draft automatically since it's likely that it's not ready for review. \`\`\`yaml pull\_request\_rules: - name: convert to draft conditions: - "#check-failure > 0" actions: edit: draft: true \`\`\` --- # Unknown \--- title: Request Reviews description: Request reviews from specific users or teams. --- The \`request\_reviews\` action lets Mergify request reviews from specified users or teams. This is useful when you want to ensure specific team members review certain pull requests. :::note GitHub accepts at most 15 review requests on a pull request, counting the requests already pending. When a rule would push a pull request past that limit, Mergify requests as many reviewers as fit, users before teams, and reports the action as neutral. ::: ## Who Gets Requested Mergify never requests a review from the pull request author, even when the author is named in \`users\`. It also skips anyone already involved: a user or team that has a pending review request, and any user who has approved, requested changes, or commented in a review on the pull request, even if that review was later dismissed. As with the \[review conditions\](/configuration/conditions#attributes-list), only reviewers with \`admin\`, \`write\` or \`maintain\` permission on the repository count here. That check applies to people: a review left by a GitHub App counts regardless of the permission the app holds. GitHub Copilot is the exception in the other direction, since Mergify ignores its reviews wherever reviews are counted, so a Copilot review never marks a pull request as already reviewed. With \`random\_count\`, those already-involved candidates count toward the target rather than being replaced. If \`random\_count\` is \`3\` and two people from your lists have already reviewed, Mergify picks one more. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to request a review on a pull request. If no \`bot\_account\` is set, Mergify will request the review itself. | | \`random\_count\` | integer or null | \`null\` | Pick random users and teams from the provided lists. When \`random\_count\` is specified, \`users\` and \`teams\` can be a dictionary where the key is the login and the value is the weight to use. Weight must be between 1 and 65535 included. | | \`teams\` | list of string or object | | The team names to request reviews from. | | \`users\` | list of string or object | | The usernames to request reviews from. | | \`users\_from\_teams\` | list of string or object | | The team names to get the list of users to request reviews from. | ## Examples ### Request a Review for Sensitive Files Ask the security team to review whenever a pull request changes files under \`security/\`. \`\`\`yaml pull\_request\_rules: - name: request a security review conditions: - files ~= ^security/ actions: request\_reviews: teams: - security \`\`\` --- # Unknown \--- title: Update description: Update the pull request branch with its base branch. --- The \`update\` action instructs Mergify to update the pull request branch with its base branch. ![Mergify Branch Update](https://docs.mergify.com/workflow/actions/%7BupdateBranchScreenshot%7D) When this action is added to a rule, Mergify will update the pull request branch with the latest changes from its base branch, if necessary. This is done by merging the base branch into the pull request branch. :::note You do not need to use this action if you use the \[merge queue\](/merge-queue). The merge queue automatically updates the pull requests it processes as necessary, making sure they are tested with up-to-date code before being merged. ::: ## Update Requirements Whatever your conditions are, Mergify adds its own requirements before running the action. A pull request is updated only when it is open, has no conflict, is not in a merge queue (\[\`queue-position = -1\`\](/configuration/conditions#attributes-list)), and is behind its base branch (\`#commits-behind > 0\`). ## Fork Pull Requests This action writes the pull request's head branch. On a pull request opened from another repository, Mergify writes that branch only when it belongs to your repository or to a fork of it, and reports why on the pull request when it does not. A queue that uses \[in-place checks\](/merge-queue/batches#in-place-checks-no-batch-prs) writes that branch too, and runs the same check when a pull request asks to be queued, so such a pull request is refused when it enters the queue rather than dequeued later. That comparison can only refuse a write when your own repository is itself a fork: any other repository is the root of its own fork network, so every head it sees descends from it. On a fork, Mergify refuses a head branch that lives in the repository yours was forked from, in a sibling fork, or in a fork more than one level below yours, since it compares only the head repository's immediate parent and the root of its fork network. It also refuses a head branch in a repository it cannot read, such as a private fork outside your Mergify installation. A head branch whose repository has been deleted is refused on any repository, fork or not, since nothing is left to say which repository that branch belongs to. The update action checks one more thing, and checks it before any of the above. When your repository is public, Mergify refuses to update a pull request from a fork whose author has not ticked GitHub's \["Allow edits from maintainers"\](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) box, and the check run asks them to tick it. The box is not required when your repository is private. A queue using in-place checks requires it whatever the visibility, when a pull request asks to be queued. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to update a pull request. If no \`bot\_account\` is set, Mergify will update the pull request itself. | ## Examples ### Update When Behind You can ask Mergify to update your pull requests when they are a few commits behind their base branch, for example: \`\`\`yaml pull\_request\_rules: - name: automatic update of pull requests that are more than 5 commits behind conditions: - base = main - "#commits-behind > 5" actions: update: \`\`\` ### Linear History As GitHub supports linear history in pull request settings, it is very handy to use a rule to keep your pull requests up-to-date. As you do not want to trigger your CI too often by always re-running it on every pull request (especially when there is still work in progress), you can limit this action to labeled pull requests. \`\`\`yaml pull\_request\_rules: - name: automatic update for pull requests marked as "keep-up-to-date" conditions: - -draft # filter-out draft PRs - label = keep-up-to-date actions: update: \`\`\` When a pull request is not a draft, and has the label \`keep-up-to-date\`, it will be automatically updated with its base branch. --- # Unknown \--- title: Label description: Add, remove, or toggle labels on a pull request. --- The \`label\` action allows Mergify to automatically add or remove labels from a pull request based on the conditions specified in your rules. A label named in \`add\` or \`toggle\` that does not exist in the repository yet is created with a randomly picked color. Create it yourself first if you want to choose its color and description. Mergify only adds labels the pull request does not already carry, and only removes ones it does, so a rule whose conditions keep matching does not keep calling GitHub. :::caution \*\*Avoid rule pairs that flip the same label.\*\* If one rule adds a label and another removes it, and both rules' conditions keep matching after each flip, the label toggles back and forth indefinitely. Every change re-triggers rule evaluation. Scope your conditions so they become mutually exclusive once the label is applied. For example, guard post-merge cleanup rules with the \`merged\` condition and drop that label from any opposing rule's conditions. ::: :::caution \*\*Avoid using labels to trigger CI workflows.\*\* GitHub Actions workflows subscribed to \`labeled\` or \`unlabeled\` pull request events run on every label change. Coupling CI to label state makes runs sensitive to any actor that touches labels (people or automation) and can amplify the cost of a misbehaving rule into redundant workflow runs on a single pull request. Trigger CI from code events such as \`push\` or \`pull\_request\` and reserve labels for state and visibility. ::: ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`add\` | list of string | | The list of labels to add. | | \`remove\` | list of string | | The list of labels to remove. | | \`remove\_all\` | boolean | \`false\` | Remove all labels from the pull request. | | \`toggle\` | list of string | | Toggle labels in the list based on the conditions. If all the conditions are a success, all the labels in the list will be added, otherwise, they will all be removed. | ## Examples ### WIP \`\`\`yaml pull\_request\_rules: - name: add "WIP" label when the title contains "WIP" conditions: - title ~= WIP actions: label: toggle: - WIP \`\`\` In this example, Mergify will automatically add the "WIP" label to any pull request whose title contains "WIP". If the pull request does not match the rule anymore, the label will be removed. ### Warn on Conflicts When browsing the list of pull requests, GitHub does not give any indication on which pull requests might be in conflict. Mergify lets you do this by adding a label. \`\`\`yaml pull\_request\_rules: - name: warn on conflicts conditions: - conflict actions: comment: message: "@{{author}} this pull request is now in conflict 😩" label: toggle: - conflict \`\`\` Then, your pull request list will look like this on conflict: ![Pull request in conflict in pull request list](https://docs.mergify.com/workflow/actions/%7BprConflictScreenshot%7D) ### Toggle A Label Based on CI Status This rule toggles a label based on the failure status of a CI system. \`\`\`yaml pull\_request\_rules: - name: toggle labels based on CI state conditions: - check-failure = CI actions: label: toggle: - "CI:fail" \`\`\` ### Add A Label Based on The Target Branch This rule adds a static label to pull requests targeting a given branch. \`\`\`yaml pull\_request\_rules: - name: label pull requests targeting the release branch conditions: - base = release actions: label: add: - "release" \`\`\` --- # Unknown \--- title: Review description: Automate reviews for your pull requests with customizable comments and review types. --- The \`review\` action provides you with an automated way to review pull requests. This can be particularly useful in situations where you want to automatically approve pull requests that meet certain criteria, or to request changes on a pull request when a particular check fails. ## How Reviews Are Posted Mergify applies these rules when it posts a review: - Mergify skips a review whose type and body already match one it posted on the pull request. It posts the review again if it has posted the opposite type since: an \`APPROVE\` after a \`REQUEST\_CHANGES\`, or the reverse. - That comparison only covers reviews posted under the same account, so changing \`bot\_account\` makes Mergify post an otherwise identical review again under the new one. - On a merged pull request, only \`COMMENT\` is posted. \`APPROVE\` and \`REQUEST\_CHANGES\` are ignored, and the action still reports a success — a green check there is not proof that a review was posted. - A \`REQUEST\_CHANGES\` or \`COMMENT\` review with no \`message\` is posted with a default body. Set \`message\` to choose the wording yourself. ## Parameters | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to review a pull request. If no \`bot\_account\` is set, Mergify will review the pull request itself. | | \`message\` | simple-template or null | \`null\` | The message to post in the review | | \`type\` | \`APPROVE\` or \`REQUEST\_CHANGES\` or \`COMMENT\` | \`"APPROVE"\` | The type of review to post | ## Examples ### Approve a pull request when all checks have passed \`\`\`yaml pull\_request\_rules: - name: automatic approval conditions: - check-success = myfirstCIname - check-success = mysecondCIname actions: review: type: APPROVE \`\`\` In this example, Mergify will automatically approve any pull request once all checks have passed successfully. ### Approve Dependabot Pull Requests You can use Mergify to review a pull request on your behalf. This can be handy if you require a minimum number of reviews to be present on a pull request (e.g., due to \[branch protection\](https://docs.github.com/en/github/administering-a-repository/about-protected-branches)) but want to automate some merges. \[Dependabot\](https://github.com/features/security) is the bot behind GitHub's automatic security updates. It sends automatic updates for your project's dependencies, making sure they are secure. You can automate the approval of pull requests created by \`dependabot\` with a rule such as: \`\`\`yaml pull\_request\_rules: - name: automatic approval for Dependabot pull requests conditions: - author = dependabot\[bot\] actions: review: type: APPROVE message: Automatically approving dependabot \`\`\` --- # Unknown \--- title: "Expose the number of added/deleted/modified lines" date: 2024-03-13 tags: - Rules description: "New \`#added-lines\`, \`#deleted-lines\`, and \`#modified-lines\` attributes expose line-change counts in conditions and templates." --- Pull request attribute about the number of added, deleted and modified lines is now exposed via \`#added-lines\`, \`#deleted-lines\` and \`#modified-lines\`. --- # Unknown \--- title: "Add support for \`description\` key in \`pull\_request\_rules\`" date: 2024-03-01 tags: - Rules description: "New \`description\` key documents what each pull request rule does." --- A new \`description\` key is available for pull request rules and allows to store a description of the rule. --- # Unknown \--- title: "Queue action options deprecation" date: 2024-07-26 tags: - Workflow Automation description: "All \`queue\` action options are deprecated — configure them under \`queue\_rules\` instead." --- The \[queue\](https://docs.mergify.com/workflow/actions/queue/) action from workflow automation has deprecated all of its configuration options. You should configure queue options directly in the \`queue\_rules\` configuration for each queue. A brownout day is planned the 2024-09-16 and the options will be removed the 2024-10-21. --- # Unknown \--- title: "Allow to specify merge\_conflict\_style for copy and backport actions" date: 2024-05-28 tags: - Workflow Automation description: "Set \`merge\_conflict\_style: diff3\` on \`copy\` and \`backport\` to use the diff3 style for conflict markers." --- You can now specify the \`merge\_conflict\_style\` options to \`diff3\` to have the conflicting code created using this style. --- # Unknown \--- title: "Add allow\_checks\_interruption option in priority\_rules section" date: 2024-09-13 tags: - Merge Queue description: "Priority rules now support \`allow\_checks\_interruption\`, letting higher-priority PRs interrupt running checks." --- The \`priority\_rules\` section of the configuration file now supports the \`allow\_checks\_interruption\` option. This means that a pull request matching one of the priority rule can interrupt existing checks if it has a higher priority than the running checks. --- # Unknown \--- title: "Merge Queue Freeze API is deprecated" date: 2024-11-21 tags: - Merge Queue description: "The Freeze API is replaced by the Pause API, which adds \`allow\_checks\_to\_run\` to mimic the previous behavior." --- The freeze feature of the merge queue has been deprecated. It is now replaced by the Pause API who offers a new \`allow\_checks\_to\_run\` option. This can be set to \`true\` to mimic the current behaviour of the freeze API. --- # Unknown \--- title: "Merge Protections reports pending events" date: 2024-11-07 tags: - Merge Protections description: "Merge protections with pending conditions (running CI, schedules) now report as pending instead of failing." --- Merge protections rules that includes pending conditions (such as CI jobs running or schedule) will now report the status of merge protections to \*pending\*. This makes sure that merge protections respects the expected outcome of the conditions written. --- # Unknown \--- title: "Deprecated \`autoquash\` option removal" date: 2025-02-14 tags: - Merge Queue - Rules description: "The deprecated \`autosquash\` option has been removed from the \`queue\` action — set it under \`queue\_rules\` instead." --- The deprecated \`autosquash\` option has been removed from the \`queue\` action. It must be used from the \`queue\_rules\` section. --- # Unknown \--- title: "Datadog integration" date: 2024-11-04 tags: - Integrations description: "New agent-less Datadog integration sends merge queue metrics straight from Mergify — enable it from your dashboard." --- A new Datadog integration has been released! This integration is now agent-less and relies on our system to send metrics. You can enable it directly from your dashboard; read the \[docs here\](https://docs.mergify.com/integrations/datadog/). --- # Unknown \--- title: "Add deployment success/failure to conditions" date: 2025-03-31 tags: - Rules description: "New \`deployment-success\` and \`deployment-failure\` conditions list a pull request's deployments and their outcome." --- Two new conditions are now available when evaluating conditions: \`deployment-success\` and \`deployment-failure\` contains the list of deployment that has been deployed — successfully or not. --- # Unknown \--- title: "Add \`max\_parallel\_checks\`" date: 2024-09-23 tags: - Merge Queue description: "New \`max\_parallel\_checks\` option for \`merge\_queue\` controls parallel checks and replaces the deprecated \`speculative\_checks\`." --- A new top-level options has been added for the \`merge\_queue\` options named \`max\_parallel\_checks\`. This settings configure the maximum number of parallel checks that can be used by the merge queue. This settings replaces and deprecated the previous settings \`speculative\_checks\`. --- # Unknown \--- title: "Autosquash disabled by default for the \`queue\` action" date: 2025-03-14 tags: - Workflow Automation - Merge Queue description: "\`autosquash\` is now off by default for the \`queue\` action, so Mergify can rebase without impersonating the author." --- The \`autosquash\` option of the \`queue\` action has been disabled by default. This allows Mergify to rebase pull requests without having to impersonate the pull request author. --- # Unknown \--- title: "Datadog scheduled freeze metrics" date: 2025-03-03 tags: - Integrations description: "The Datadog integration now sends a metric for the number of ongoing scheduled freezes." --- The number of ongoing scheduled freezes is now sent in the Datadog integration. --- # Unknown \--- title: "Remove deprecated options of \`queue\` action" date: 2025-06-24 tags: - Merge Queue - Workflow Automation description: "The deprecated options of the \`queue\` action have been removed." --- The deprecated options from the \`queue\` action have been removed. --- # Unknown \--- title: "\`max\_parallel\_checks\` is now 5 by default" date: 2025-06-02 tags: - Merge Queue description: "\`max\_parallel\_checks\` now defaults to 5, reducing merge latency without overusing CI resources." --- The default value from \`max\_parallel\_checks\` which controls how many pull requests can be tested in parallel in the queue is now set to 5 by default. This makes sure that the latency of merging pull request is reduce to a minimum by default without over consuming CI resources. --- # Unknown \--- title: "\`GET /products/{owner}\` endpoint has been removed" date: 2025-05-26 tags: - API description: "The \`GET /products/{owner}\` endpoint is replaced by \`GET /repos/{owner}\`, which returns more data." --- This endpoint has been replaced by \`GET /repos/{owner}\` endpoint which returns more data. --- # Unknown \--- title: "Allow to disable comment posting" date: 2025-07-18 tags: - Merge Protections description: "New configuration option enables or disables the comment posted by Merge Protections." --- \[A new configuration option\](https://docs.mergify.com/configuration/file-format/#merge-protections) allows to enable or disable the comment posted by Merge Protections. --- # Unknown \--- title: "\`allow\_inplace\_checks\` has been deprecated" date: 2025-09-30 tags: - Deprecations - Merge Queue description: "\`allow\_inplace\_checks\` is deprecated — checks are now placed automatically based on \`batch\_size\`, \`merge\_conditions\`, and \`max\_parallel\_checks\`." --- The option \`allow\_inplace\_checks\` from queue rules is deprecated. The checks are now perform in-place or on a draft PR depending on \`batch\_size\`, \`merge\_conditions\` and \`max\_parallel\_checks\` (cf. \[documentation\](https://docs.mergify.com/merge-queue/parallel-checks/#inplace-checks-no-drafts)). --- # Unknown \--- title: "Remove deprecated implicit priority between queue rules" date: 2025-06-30 tags: - Merge Queue description: "Implicit ordering by queue-rule definition is gone — use \`priority\_rules\` to control merge order." --- The priorities that were implied by the order of definition of your queue rules is no more. Only \`priority\_rules\` are now applied to determine the order in which the pull request will be tested and merged in the queue. --- # Unknown \--- title: "New Queue Resets & Batch Interruptions chart" date: 2025-10-27 tags: - Merge Queue description: "New dedicated chart to track errors and problems in the merge queue, including failed checks, timeouts, queue resets, and batch failures." --- We added a new dedicated chart to track errors and problems in the merge queue, including failed checks, timeouts, queue resets, and batch failures. The existing "Merge Queue Checks Outcomes" chart has been renamed to "PR Exit Reasons" and now focuses exclusively on normal operational outcomes like successful merges, manual dequeues, and PR updates. This separation makes it easier to quickly identify and prioritize CI/CD problems. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic2a3f2b37c5da80549cdbea6290c4b348png%7D) --- # Unknown \--- title: "Unsuccessful checks are displayed on checks event" date: 2025-10-29 tags: - Merge Queue description: "Better way to find unsuccessful checks" --- In the queue activity and in the history of a pull request, you can see the list of checks that were unsuccessful on each “Checks” event. You are also able to click on a check to navigate to its result directly on GitHub. --- # Unknown \--- title: "Skip intermediate results" date: 2025-11-12 tags: - Merge Queue description: "Allows merging a PR early if a later batch including it passes all checks and conditions." --- A new option named \`skip\_intermediate\_results\` has been added to the \`merge\_queue\` section of the Mergify configuration. This option allow PRs to be merged even if their own speculative is not finished, as long as a later downstream check including them passes and schedule conditions are valid. --- # Unknown \--- title: "Improved Merge Queue status reporting" date: 2025-12-11 tags: - Merge Queue description: "Release of the Merge Queue status updates" --- Mergify now provides \*\*richer, more informative status updates\*\* directly on your pull requests when they enter the Merge Queue. Instead of a single, static message, PRs now get \*\*step-by-step feedback\*\* about what’s happening: preparing the batch, waiting for CI, retrying, scheduled waits, and more. This gives developers clearer visibility into progress and removes the guesswork around “where is my PR?”. This will include an estimated time of merge (still rolling out). ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic2c6f2b37c5da80c59b99ee075625534dpng%7D) --- # Unknown \--- title: "Allow to configure merge queue comment reporting" date: 2025-12-24 tags: - Merge Queue description: "The status reported by the merge queue as comments can now be configured" --- Adding \`status\_comments\` property to \[merge queue configuration\](https://docs.mergify.com/configuration/file-format/#merge-queue) to reduce the level of reporting for queue status on github pull request: - \`all\`: Post comments for all queue events (entering queue, CI progress, outcomes). - \`outcomes\`: Only post comments for final outcomes (merged or dequeued with failure reason). Example: \`\`\`yaml merge\_queue: status\_comments: outcomes \`\`\` --- # Unknown \--- title: "Add none option to status\_comments for merge queue" date: 2026-01-07 tags: - Merge Queue description: "A new \`none\` value is now available for the \`status\_comments\` configuration option to completely disable merge queue status comments on pull requests. " --- The \`status\_comments\` option in the \`merge\_queue\` configuration now supports a \`none\` value, which disables all merge queue status comments on pull requests. This provides users with three levels of control over queue notifications: - \`all\` (default): Post comments for all queue events, including entering the queue, CI progress updates, and final outcomes - \`outcomes\`: Only post comments for final outcomes (merged or dequeued with failure reason) - \`none\`: Do not post any comments for queue status Example configuration: \`\`\`yaml merge\_queue: status\_comments: none \`\`\` This is useful for repositories that want to reduce notification noise and rely solely on the merge queue dashboard or other monitoring tools for queue status updates. --- # Unknown \--- title: "Adding merge queue commands to event log" date: 2025-11-14 tags: - Merge Queue description: "Commands for the merge queue are now recorded as part of the event log" --- Commands \`queue\`, \`dequeue\`, and \`requeue\` are now logged as events. This improves traceability by capturing both the author and the originating comment for each command. --- # Unknown \--- title: "New Merge Queue status dashboard" date: 2026-01-13 tags: - Merge Queue description: "The redesigned merge queue interface is now available to everyone" --- A redesigned experience for the merge queue is now available. What's new: - Clearer visualization of batched and queued pull requests with distinct sections - Enhanced batch states, including bisecting batch visualization - Improved performance with optimized data fetching Prefer the classic view? Use "Go back to the old experience" to switch anytime. Your preference will be saved. We're excited for you to try it out! --- # Unknown \--- title: "Allow to configure schedule freeze exclusion conditions" date: 2026-01-13 tags: - Merge Protections description: "Schedule Freeze exclusion conditions can now be configured" --- You can now configure exclusion conditions directly on a Scheduled Freeze. This makes it much easier to exclude specific pull requests from a freeze, without having to rely on workarounds that match conditions. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic2e7f2b37c5da80f9be76d4e48baf34c2png%7D) --- # Unknown \--- title: "Scopes and batch lineage in queue event logs" date: 2026-07-08 tags: - Merge Queue description: "Merge queue check events now carry the batch's scopes and parent batch ids (plus a batch\_id on leave), so you can reconstruct check history from the event logs alone." --- The \`action.queue.checks\_start\`, \`action.queue.checks\_end\`, and \`action.queue.leave\` events now include the batch's \`scopes\` and its \`parent\_batch\_ids\`. \`scopes\` tell you which parallel lane a batch ran in: batches with disjoint scopes check concurrently. \`parent\_batch\_ids\` let you chain a batch back to the ones it inherited check results from. \`action.queue.leave\` also gains a \`batch\_id\`, the batch the pull request was in when it left, so you can correlate a leave with its checks. Together these let you rebuild what the queue was checking at a point in time from the event logs alone. We also renamed \`train\_car\_id\` to \`batch\_id\` on the check and bisection events. \`train\_car\_id\` still ships as a deprecated alias with the same value, so existing integrations keep working. --- # Unknown \--- title: "Add ability for retry rules to retry entire pipelines" date: 2026-01-19 tags: - CI Insights description: "Allow users to retry rules by choosing the retry mode" --- A new option named \`retry mode\` has been added to the configuration page of \`retry rules\`. This option introduce the ability to choose the retry mode of the retry rules, retrying either the failed jobs or the entire pipeline. --- # Unknown \--- title: "skip\_intermediate\_results now works in parallel merge queue mode" date: 2026-07-08 tags: - Merge Queue description: "The skip\_intermediate\_results option, previously serial-only, now also speeds up merges in parallel mode within each scope's dependency chain." --- When \`skip\_intermediate\_results\` is enabled, Mergify merges a pull request as soon as a later batch that includes it passes its checks, instead of waiting for the PR's own speculative check. Previously available only in serial mode, it now applies in parallel mode too — within each scope's dependency chain, a passing batch promotes its not-yet-merged ancestors so busy scopes get the same speedup serial queues already enjoy. --- # Unknown \--- title: "\`autosquash\` has been deprecated" date: 2026-01-27 tags: - Deprecations description: "\`autosquash\` option will be removed soon" --- The option \`autosquash\` from \`queue\_rules\` and \`rebase\` action is deprecated and will be removed in the foreseeable future. --- # Unknown \--- title: "Trace a restarted batch back to its previous attempt" date: 2026-07-08 tags: - Merge Queue description: "The merge queue activity log now links a restarted batch to the previous batch it retried." --- When a batch restarts because its previous attempt was aborted, the merge queue activity log now shows a link to that earlier batch. Clicking it opens the previous batch — including its checks and why it stopped — even after it has left the queue, so you can trace a restart end to end instead of hitting a dead end. --- # Unknown \--- title: "Merge queue stats metrics and dashboard in Datadog" date: 2026-07-17 tags: - Integrations - Merge Queue description: "The Datadog integration now ships 19 new mergify.queue.\* metrics covering merge queue throughput, queue health, and performance, plus an out-of-the-box dashboard." --- Version 2.0.0 of the Mergify integration for Datadog goes much deeper on merge queue monitoring. It adds 19 \`mergify.queue.\*\` metrics covering throughput (pull requests entered and merged, queue and batch size), queue health (exit reasons, check outcomes, CI retries, bisections), and performance (time in queue, CI runtime, idle waits), all tagged by \`repository\`, \`branch\`, \`queue\`, and \`priority\_rule\`. The integration also bundles an out-of-the-box \*\*Mergify - Merge Queue Stats\*\* dashboard, ready to use as soon as metrics flow in. The legacy metrics (\`mergify.merge\_queue\_length\`, \`mergify.time\_to\_merge.\*\`, \`mergify.queue\_checks\_outcome\`) are deprecated in favor of the new \`mergify.queue.\*\` metrics. Enable the integration from your Mergify dashboard — see the \[Datadog integration docs\](https://docs.mergify.com/integrations/datadog/). --- # Unknown \--- title: "Extended statistics date range to 3 months" date: 2026-04-21 tags: - Merge Queue description: "You can now view merge queue statistics for up to 3 months instead of the previous 1-month limit." --- The statistics date picker now includes "Past 2 Months" and "Past 3 Months" presets, giving you a broader view of your merge queue performance over time. The underlying data retention has been aligned to 90 days, so all presets return complete data. --- # Unknown \--- title: Security description: "Mergify's security posture: compliance, data handling, access control, and the GitHub App permissions we request." --- Mergify runs in front of GitHub to evaluate merge conditions and orchestrate your pipeline. This page documents our compliance posture, how we handle your data, the access controls in place, and the GitHub App permissions we request. ## Compliance Mergify is \*\*SOC 2 Type II\*\* attested. Reports, audit details, and our sub-processor list are available in the Trust Center. Trust Center A Data Processing Addendum (DPA) is available on request. Contact [security@mergify.com](mailto:security@mergify.com) . ## Data Handling :::note Mergify does not store your repository contents. For a git operation such as a rebase or a merge, it clones the repository into a temporary working directory and deletes that directory once the operation finishes. ::: - \*\*Encryption in transit:\*\* TLS 1.2 or higher. - \*\*Encryption at rest:\*\* persisted service data, such as configuration and metadata, is encrypted with AES-256. - \*\*Service status:\*\* real-time availability and incident history at \[status.mergify.com\](https://status.mergify.com). ## Access Control Mergify does not maintain a separate identity or permission system. All authentication and authorization are delegated to GitHub. Users sign in through GitHub, and roles are inherited directly from \[GitHub roles\](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization). A user with the \`Read\` role on a repository in GitHub also has the \`Read\` role in Mergify. Some operations also require the GitHub organization \`Owner\` role. See the \[Features Permissions\](#features-permissions) table below for the full mapping between GitHub roles and Mergify capabilities. ### Single Sign-On (SSO) GitHub is the only way to sign in to Mergify. There is no native Mergify login (no email/password) and no way to connect your identity provider directly to Mergify. Sign-in goes through GitHub OAuth, so whatever authentication policy you enforce on your GitHub organization (including SAML SSO with Okta, Azure AD, Google Workspace, or any other identity provider) applies automatically to Mergify. To enforce SSO for your team's Mergify access, configure SAML SSO on your GitHub organization. GitHub's documentation covers the steps for each identity provider: \[About identity and access management with SAML single sign-on\](https://docs.github.com/en/organizations/managing-saml-single-sign-on-for-your-organization/about-identity-and-access-management-with-saml-single-sign-on). :::note Once SAML SSO is enforced on your GitHub organization, users signing in to Mergify are redirected through your identity provider on session expiry, just like any other GitHub-authenticated tool. No additional Mergify configuration is required. ::: If your organization also restricts GitHub access by IP, see \[Managing IP Addresses\](#managing-ip-addresses-allowed-for-the-github-app). Mergify's IPs must be allowlisted for OAuth sign-in to succeed. ### Delegated Roles Some Mergify operations (such as managing the subscription, managing CI Insights self-hosted runners, or configuring third-party integrations) require the GitHub organization \`Owner\` role by default. To avoid granting full GitHub \`Owner\` rights to a teammate who only needs one of these capabilities, GitHub \`Owner\`s can delegate scoped Mergify admin powers to any organization member or collaborator from the Mergify dashboard. Delegated roles are managed from \*\*Settings → Roles\*\* on the Mergify dashboard. Only GitHub \`Owner\`s and users holding the \*\*Delegation Admin\*\* role can grant or revoke them. Granting and revoking delegated roles requires the Enterprise plan; see \[Mergify's pricing page\](https://mergify.com/pricing). On other plans, the operations described above stay with the GitHub organization \`Owner\`s. :::note \*\*Exception: subscribing.\*\* Subscribing is a self-service action. Any organization member can start a trial or put a product on the organization's subscription, even without the GitHub \`Owner\` role, and Mergify automatically grants them the \*\*Billing Admin\*\* role so they can manage what they just started. Outside collaborators cannot, because subscribing requires organization membership. This is not confined to an organization's first subscription. A member who adds a product an established organization does not already have is granted the role the same way. Two things do not trigger it: opening a checkout page without completing it, and subscribing to a plan or to a product the organization already has, which is rejected. Billing Admin grants billing access only. It grants no repository, queue, or configuration access, and like every delegated role it cannot take a user past what their GitHub role already allows on the underlying repositories. ::: Each user can hold any combination of the following roles: | Role | Grants | | --- | --- | | Billing Admin | Manage the Mergify subscription and billing details: invoices, plan changes, and the Stripe customer portal. | | CI Admin | Configure CI Insights at the organization level (self-hosted runner fleet) and manage CI-scoped application keys. | | Integrations Admin | Configure the default products for new repositories and the Slack and Datadog notification integrations at the organization level. | | Delegation Admin | Manage the delegated-role roster itself: grant or revoke any of the roles above (including this one) to other users. | :::note Delegated roles only extend Mergify-side privileges. They do not grant any GitHub permission, and they cannot upgrade a user past what their GitHub role already allows on the underlying repositories. ::: ## Vulnerability Disclosure Mergify hosts a public Bug Bounty program with HackerOne. If you believe you've found a security issue on our platform, please disclose it responsibly. Submit a vulnerability For other security questions or concerns, contact our security team at [security@mergify.com](mailto:security@mergify.com) . ## Reference Mergify requests a fixed set of GitHub App permissions required for the product to operate. Some permissions are only exercised by specific features. ### GitHub App Required Permissions Below is the list of the required permissions on GitHub for Mergify to function properly. | Permission | Access | Usage | | --- | --- | --- | | Repository: Actions | Read and write | Used to read workflow runs and job logs, and to re-run workflow runs and failed jobs for CI Insights Auto-Retry. | | Repository: Administration | Read-only | Used to read branch protection settings and repository rulesets. | | Repository: Checks | Read and write | Used to read and post checks. | | Repository: Commit statuses | Read-only | Used to read checks status. | | Repository: Contents | Read and write | Used to read repository content and write (merge). | | Repository: Deployments | Read and write | Used to read and post deployments status. | | Repository: Issues | Read and write | Used to read and write the parts of a pull request that GitHub serves under its Issues API: labels, assignees, comments, and reactions on comments. | | Repository: Metadata | Read-only | Access repository metadata. | | Repository: Merge queues | Read-only | Used to receive GitHub merge queues events. | | Repository: Pages | Read and write | Used so that GitHub publishes your Pages site after a merge Mergify performs: without write access, GitHub does not start the Pages workflow for that merge and the site does not update. Mergify makes no Pages API call itself. | | Repository: Pull requests | Read and write | Used to read and edit pull requests. | | Repository: Workflows | Read and write | Used to read workflows and to write a pull request's changes under `.github/workflows/`: merging that pull request, updating its branch, or copying it to another branch with the `backport` or `copy` action. Without this permission, GitHub refuses the write and Mergify reports the missing permission. | | Organization: Administration | Read-only | Used to receive organization-level ruleset events and read the organization's default repository permission. | | Organization: Members | Read-only | Used to list organization members. | | Account: Email addresses | Read-only | Used to read user email addresses. | \### Features Permissions To perform any action on Mergify (such as adding a pull request to a merge queue or triggering a command), a user must have sufficient access to the relevant account or resource. Permissions are inherited from GitHub roles. | Feature | Repository role | | | | | Organization role | | --- | --- | --- | --- | --- | --- | --- | | Read | Triage | Write | Maintain | Admin | Owner | | --- | --- | --- | --- | --- | --- | --- | | Merge Queue | | | | | | | | View the merge queue | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | Pause the merge queue | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | Merge Protections | | | | | | | | View merge protection status | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | Edit merge protection rules in `.mergify.yml` | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | Schedule a queue freeze | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | CI Insights | | | | | | | | View CI Insights data | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | Activate CI Insights on a repository | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | Manage CI Insights Auto-Retry rules | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | Configure CI Insights self-hosted runners | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | | Test Insights | | | | | | | | View Test Insights data | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | Quarantine or unquarantine tests | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | Configure Test Insights Auto-Quarantine | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | Account | | | | | | | | Manage API keys | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | | Manage Mergify subscription | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | | Products & Integrations | | | | | | | | GitHub integration: Enable or disable Mergify products | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ | | GitHub integration: Configure default products for new repositories | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | | Third-party integrations: Configure Slack and Datadog notification integrations | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | :::note Owner-only operations marked above can be delegated to non-Owner users through Mergify's \[delegated roles\](#delegated-roles), without granting them the GitHub \`Owner\` role. The mapping is: - \*\*Billing Admin\*\*: manage Mergify subscription. - \*\*CI Admin\*\*: manage API keys (CI scope only) and manage CI Insights self-hosted runners. - \*\*Integrations Admin\*\*: configure default products for new repositories and configure third-party integrations (Slack, Datadog, etc.). - \*\*Delegation Admin\*\*: grant or revoke any of the roles above. API keys with the \`admin\` scope still require the GitHub \`Owner\` role. ::: ### Command Permissions \[Mergify commands\](/commands) are \[restricted by default\](/commands/restrictions/#default-restrictions) and have their own mechanism that can be modified. See \[Commands Restrictions\](/commands/restrictions/) for changing the default. ### Action Permissions Actions in \[\`pull\_request\_rules\`\](/workflow/rule-syntax) have no equivalent default restriction. They run whenever a pull request matches the rule's conditions, whoever opened it, and Mergify runs them with its own permissions or with those of the \`bot\_account\` you configure. The conditions are what scopes a rule. This matters for actions writing to the pull request's head branch, such as \[\`update\`\](/workflow/actions/update), because its author picks that branch. On a same-repository pull request it is one of your branches, and opening a pull request from a branch that already exists takes only read permission, so a rule whose conditions describe only the state of a pull request acts on whichever branch that person named as the head. Conditions on the \[author\](/configuration/conditions#attributes-list) or on a \`label\`, or a pattern on \`head\`, keep the rule off the branches you care about. The same reasoning drives the default \[restrictions\](/commands/restrictions) on the \`update\`, \`rebase\` and \`squash\` commands. ## Managing IP Addresses Allowed for the GitHub App \[GitHub allows you to configure the list of IP addresses\](https://docs.github.com/en/apps/maintaining-github-apps/managing-allowed-ip-addresses-for-a-github-app) that a GitHub App is allowed to use to access GitHub. Mergify services use the following IP addresses: - 34.121.26.35/32 - 34.45.103.142/32 - 34.69.118.185/32 - 34.63.9.219/32 - 136.119.26.243/32 :::note Even though these IP addresses appear in the GitHub allow list as "Managed by Mergify GitHub App", they must be manually added to the list by an organization administrator. GitHub does not allow OAuth authentication to our dashboard if these IPs have not been manually added. ::: --- # Unknown \--- title: Stacks description: Break large changes into small, reviewable pull requests. One branch, many PRs. --- AI can write 1,000 lines of code in minutes, but nobody wants to review a 1,000-line pull request. Reviewers skim instead of reading, bugs slip through, and merges stall for days. Get Started → Give your agent this link → \## The Problem: One Branch = One PR GitHub's pull request model ties every branch to a single PR. As you add commits, the PR grows, and so does the review burden. Developers face a bad choice: ship one giant PR that no one can review thoroughly, or manually manage a chain of dependent branches and rebase each one whenever the base changes. Git has the tools to split work into atomic commits. GitHub just doesn't expose them as separate, reviewable units. ## The Solution: One Branch, Many PRs Mergify Stacks maps each commit on your branch to its own pull request, automatically chained in dependency order. You work on a single local branch using standard Git: commits, rebase, amend. When you push, Stacks creates a separate PR for each commit, linked together so reviewers see the logical progression of your work. - Small, focused PRs that reviewers actually read - One local branch (no juggling N branches for N PRs) - Automatic PR chaining with dependency tracking - Smart updates that only touch PRs that changed - Everyday Git for daily work: the commit and rebase commands you already use - Ships with skills for Claude Code, Cursor, and any agent supporting \[skills.sh\](https://skills.sh) - Complements \[Merge Queue\](/merge-queue) for safe, fast landing ## Get Started in 30 Seconds \*\*For your AI coding agent:\*\* share this URL: \`\`\`text https://docs.mergify.com/stacks/agents \`\`\` Your agent installs the CLI and the Stacks skill itself, then you prompt it as usual. \*\*For yourself:\*\* See the \[setup guide\](/stacks/setup) for the full walkthrough. ## Learn More A single URL to hand your AI coding agent so it installs the CLI and the Stacks skill itself. How stacks work under the hood: Change-Ids, branch mapping, and PR chaining. Install the CLI and configure your repository in under 2 minutes. Walk through creating your first stack from branch to PRs. Amend, reorder, squash, or add commits and keep PRs in sync. A reviewer's guide to navigating and reviewing stacked PRs. Why and how to roll out stacked PRs across your engineering team. Honest comparisons with gh-stack, Graphite, and other stacking tools. --- # Unknown \--- title: "Declare merge queue barrier files in your configuration" date: 2026-07-17 tags: - Merge Queue description: "You can now mark files that impact every scope directly in your Mergify configuration, so any pull request touching them runs alone in the merge queue." --- When you split your merge queue into parallel scopes with file patterns, some files — CI workflows, build files, shared tooling — affect everything. Add a \`barrier\_files\` list to your \`scopes\` configuration and any pull request changing a matching file automatically becomes a merge-queue barrier: it runs on its own and serializes the queue at that point, instead of merging in parallel with other scopes. Previously this could only be triggered through the scopes API. --- # Unknown \--- title: Stacks for AI Agents description: One-page bootstrap for AI coding agents to install the Mergify CLI and the Stacks skill. --- You are an AI coding agent. Follow these four steps to enable stacked pull request support. After step 2, your skill system will contain the full Stacks workflow. Consult it for any stack-related task. ## 1. Install the Mergify CLI Install \`mergify-cli\` with the install script: Verify: \`\`\`bash mergify --version \`\`\` ## 2. Install the Stacks skill Pick the command that matches your runtime. \*\*Claude Code:\*\* \`\`\`text /plugin install mergify@claude-plugins-official \`\`\` This installs the unified \`mergify\` plugin, which includes the Stacks skill (along with skills for the merge queue, CI Insights, and more). \*\*Codex, Cursor, and any other agent supporting \[skills.sh\](https://skills.sh):\*\* \`\`\`bash npx skills add Mergifyio/mergify-cli \`\`\` The skill contains the full Stacks workflow (commands, rules, and common scenarios). Load it before performing any stack work. ## 3. Initialize the repository Run in the repository root: \`\`\`bash mergify stack setup \`\`\` This installs the Git hooks Stacks relies on: \`commit-msg\` generates a \`Change-Id\` for every new commit, \`prepare-commit-msg\` keeps it through \`git commit --amend -m\`, \`post-commit\` adds one to a commit that still lacks it, and \`pre-push\` stops a \`git push\` on a stack branch and points to \`mergify stack push\`. See \[Setup\](/stacks/setup#4-initialize-your-repository) for the full list. ## 4. Make sure a GitHub token is available Stacks creates and updates pull requests through the GitHub API, so \`mergify stack push\` needs a GitHub token. It reads \`--token\` first, then \`MERGIFY\_TOKEN\`, then \`GITHUB\_TOKEN\`, then the token of an authenticated \[GitHub CLI\](https://cli.github.com/) (\`gh auth token\`). If none of those is set, run \`gh auth login\` or export a token: \`\`\`bash export GITHUB\_TOKEN=your\_token\_here \`\`\` A Mergify \[application key\](/api/usage#application-key-scopes) is not a GitHub token. If \`MERGIFY\_TOKEN\` holds one, pass the GitHub token as \`--token\` instead, or the push fails. See \[GitHub token for Stacks\](/cli/usage#github-token-for-stacks). ## You are ready The skill installed in step 2 contains the workflow. Follow it for any stack-related task. --- # Unknown \--- title: Support description: Learn how to reach the Mergify support team, understand coverage, and explore enhanced support options. --- This page explains how to contact Mergify support and what to expect from a support request. ## Contact Support Immediately If you are stuck, use one of the following channels: 1. \*\*Email:\*\* [support@mergify.com](mailto:support@mergify.com) . Include the affected repository, pull request number, and a short description (screenshots/log excerpts encouraged) so we can reproduce quickly. 2. \*\*In-app ticket:\*\* From the Mergify dashboard, open the \*\*Help Center\*\* in the sidebar and pick \*\*Contact us\*\*. Choose the \*\*Problem\*\*, \*\*Question\*\*, or \*\*Feedback\*\* tab, describe the issue, and attach files. The \*\*Problem\*\* tab also takes the URLs of the pull requests concerned. We automatically attach account context, which speeds up triage. 3. \*\*Status follow-up:\*\* Track platform availability at [status.mergify.com](https://status.mergify.com/) and reference incident IDs in your ticket for targeted updates. These options are available to every Mergify user. ## Support Overview We provide assistance to authorized users directly through the service as well as by email. While resolution times can vary depending on complexity, our team commits to best-effort responses within one (1) business day for every incoming request. You will always receive a human acknowledgement confirming the scope and next steps. Enterprise plans unlock additional collaboration channels beyond the default email queue: - \*\*Dedicated Slack channel:\*\* Eligible enterprise customers receive a shared Slack channel with the Mergify team for higher-touch incident response, proactive reviews, and faster iteration. - \*\*Named support contacts:\*\* We partner with your engineering leads to keep context warm and reduce time to resolution on recurring workflows. Reach out to your account manager if you would like to enable or adjust these enterprise options. ## Premium Support Organizations that need round-the-clock coverage can subscribe to our optional 24/7 Premium Support package. This add-on provides prioritized routing, after-hours incident handling, and direct access to on-call engineers. If you're subscribed to Premium Support, see the \[24/7 Escalation Guide\](/support/premium) for the dedicated process and contact details. Contact [sales@mergify.com](mailto:sales@mergify.com) to learn more or scope the package for your organization. ## What to Expect When you open a support request, we: 1. Acknowledge the ticket and confirm the scope within one business day. 2. Investigate using the artifacts you provided and any telemetry available on our side. 3. Publish corrective updates when needed and confirm the outcome with you. If a request requires product changes or in-depth consulting, we will clearly outline the effort and any additional agreement needed before proceeding. --- # Unknown \--- title: Copy description: Copy a pull request to another branch. --- The \`copy\` action enables you to automatically create a copy of a pull request. When the conditions you specify are met, Mergify will create a new pull request to merge the changes into the specified base branch. :::note The \`copy\` action takes the same options as the \[\`backport\`\](/workflow/actions/backport) action and does the same work. They differ in when they run: \`backport\` waits for the original pull request to be merged, while \`copy\` runs on a pull request that is not in conflict with its base branch, merged or not. The two also default to different titles and bodies. ::: Note that in case of a conflict during the copy, Mergify will create a pull request with the conflict; you will have to resolve it manually. You can change this behaviour using the \`ignore\_conflicts\` option. Mergify opens each copy from a head branch named \`mergify/copy//pr-\`, with the destination branch as its base. :::caution Please make sure the branches specified in the copy action exist and you have the necessary access permissions. If the branch does not exist or you don't have the required permissions, the action will fail. ::: ## Parameters The \`copy\` action takes a list of branches to which the changes from the pull request will be copied. The branch names should be specified as strings. \`regexes\` picks destination branches by \[pattern\](/configuration/data-types#regular-expressions) instead of naming each one. Patterns are matched against the branches that exist in the repository, and each one is anchored at the start of a branch name only, so \`release-1\` also matches \`release-10\`. Setting both \`branches\` and \`regexes\` copies to the branches you named plus the branches your patterns matched. Mergify skips any login ending in \`\[bot\]\` when resolving \`assignees\`, so a rule that assigns \`{{ author }}\` leaves the copy unassigned if a bot opened the original pull request. | Key name | Value type | Default | Description | | --- | --- | --- | --- | | \`assignees\` | list of simple-template | | Users to assign the newly created pull request to. Accepts a GitHub login, or \`{{ author }}\` (the original pull request author) or \`{{ merged\_by }}\` (the user who merged it). | | \`body\` | simple-template | \`"{{ body }} * * * This is an automatic copy of pull request #{{number}} done by \[Mergify\](https://mergify.com). "\` | The pull request's body. | | \`bot\_account\` | simple-template or null | \`null\` | Mergify can impersonate a GitHub user to copy a pull request. If no \`bot\_account\` is set, Mergify copies the pull request itself. | | \`branches\` | list of Branch Name | | The list of branches the pull request should be copied to. | | \`ignore\_conflicts\` | boolean | \`true\` | Whether to create the pull requests even if there are conflicts when cherry-picking the commits. | | \`label\_conflicts\` | string | \`"conflicts"\` | The label to add to the created pull request if it has conflicts and \`ignore\_conflicts\` is set to \`true\`. | | \`labels\` | list of string | | The list of labels to add to the created pull requests. | | \`merge\_conflict\_style\` | \`merge\` or \`diff3\` | \`"merge"\` | Style used by git when displaying merge conflicts | | \`regexes\` | list of regex | | The list of regexes to find branches the pull request should be copied to. | | \`report\_mode\` | list of \[Report Mode\](/configuration/data-types#report-mode) | \`\["check"\]\` | Reporting modes for the action's result. Check will create a check on the pull request, and comment will post a comment on the pull request. | | \`title\` | simple-template | \`"{{ title }} (copy #{{ number }})"\` | The pull request's title. | \## Examples ### Using Labels to Copy Below is an example of how to use the \`copy\` action: \`\`\`yaml pull\_request\_rules: - name: copy patches to the prod branch conditions: - label = copy-to-prod actions: copy: branches: - prod \`\`\` --- # Unknown \--- title: "Average batch size stats" date: 2025-02-19 tags: - API - Merge Queue description: "New API endpoint and dashboard chart expose average batch size statistics for your merge queue." --- The merge queue now exposes a new API endpoint for metrics around the batch size. You can discover what are the average batch size of your merge queue jobs. These statistics are also now exposed in your merge queue stats dashboard. --- # Unknown \--- title: Test Insights description: Monitor, detect, and manage unreliable tests across your repositories. hubAccent: true --- Test Insights helps you manage test reliability across the full lifecycle. It catches flaky tests on pull requests before they merge, surfaces unhealthy tests across your repositories, and lets you quarantine problematic tests so they don't block your CI pipeline. ## How it works Test Insights is organized into three phases that follow the natural lifecycle of a test reliability problem: 1. \*\*\[Prevention\](/test-insights/prevention)\*\*: Catch flaky and broken tests on pull requests before they reach your codebase. Mergify reruns tests on PRs to detect inconsistent behavior early. 2. \*\*\[Detection\](/test-insights/detection)\*\*: Identify and prioritize unhealthy tests across your repositories. See which tests are flaky or broken, and focus on the ones with the most impact. 3. \*\*\[Mitigation\](/test-insights/mitigation)\*\*: Quarantine problematic tests to unblock CI without removing them. Tests keep running, but their failures no longer block merges. You can also search test health directly from the terminal or from AI coding agents with the \[\`tests\` CLI reference\](/cli/tests). This is useful when an agent needs to decide whether a failing test is a real regression or known flakiness. ## Key concepts - \*\*Flaky test\*\*: A test that both passes and fails on the same commit. For example, passing on one run and failing on the next with identical code. A test whose results differ without ever failing stays healthy. - \*\*Broken test\*\*: A test that fails, with no passing run close in time to contradict those failures. - \*\*Health status\*\*: A test's reliability classification: healthy, flaky, or broken. Based on results from multiple CI runs. - \*\*Confidence\*\*: How much data is available to assess a test's health, reported as low, medium, or high. Low confidence means the status could still change as more runs are collected. - \*\*Quarantine\*\*: Isolating a test so its failures are ignored for merge decisions. The test still runs and results are still collected, preserving full visibility. - \*\*Default branch scope\*\*: Test health across repositories comes from runs on the default branch. Pull request runs feed \[Prevention\](/test-insights/prevention) instead. See \[which runs Detection reports on\](/test-insights/detection#which-runs-detection-reports-on). ## Setup Test Insights is powered by the same CI integration as \[CI Insights\](/ci-insights). To get started, configure your CI system and test framework: - \[GitHub Actions setup\](/ci-insights/setup/github-actions) - \[Buildkite setup\](/ci-insights/setup/buildkite) - \[Jenkins setup\](/ci-insights/setup/jenkins) - \[Test framework configuration\](#test-framework-configuration) ## Test Framework Configuration Test Insights supports many test frameworks and captures test-level data from them. Each framework requires a quick setup to ensure test results are parsed and uploaded properly. Refer to the dedicated page for your specific framework to configure and verify your test output. Integrate Cypress with Test Insights. Integrate Go with Test Insights. Integrate Jest with Test Insights. Integrate JUnit with Test Insights. Integrate Minitest with Test Insights. Integrate MSTest with Test Insights. Integrate NUnit with Test Insights. Integrate Pest with Test Insights. Integrate PHPUnit with Test Insights. Integrate Playwright with Test Insights. Integrate Pytest with Test Insights. Integrate RSpec with Test Insights. Integrate Rust with Test Insights. Integrate TestNG with Test Insights. Integrate Vitest with Test Insights. --- # Unknown \--- title: "Remove deprecated \`allow\_merging\_configuration\_change\` option" date: 2025-02-14 tags: - Workflow Automation description: "The deprecated \`allow\_merging\_configuration\_change\` option has been removed — it had been a no-op for the past year." --- The deprecated option \`allow\_merging\_configuration\_change\` has been removed. This option was not doing anything for the past year. --- # Unknown \--- title: "\`priority\_rules\` from \`queue\_rules\` removal" date: 2025-02-18 tags: - Merge Queue description: "The deprecated \`priority\_rules\` section under \`queue\_rules\` has been removed — it's now top-level." --- The deprecated section \`priority\_rules\` from the \`queue\_rules\` has been removed. \`priority\_rules\` are not a top-level item from the configuration file. --- # Unknown \--- title: "Remove deprecated \`allow\_checks\_interruption\`" date: 2025-02-14 tags: - Merge Queue description: "The deprecated \`allow\_checks\_interruption\` option has been removed." --- The deprecated option \`allow\_checks\_interruption\` has been removed. --- # Unknown \--- title: "Removal of queue freeze attributes" date: 2025-02-25 tags: - Deprecations description: "The \`queue-freeze\` and \`queue-freeze-reason\` pull request attributes have been removed." --- The \`queue-freeze\` and \`queue-freeze-reason\` attributes of pull request used in conditions have been removed. --- # Unknown \--- title: "Statistics by priority" date: 2025-03-11 tags: - Merge Queue description: "Merge Queue statistics are now broken down by pull request priority." --- The Merge Queue statistics are now available per pull request priority. --- # Unknown \--- title: "CI Insights PR report" date: 2025-07-31 tags: - CI Insights description: "CI Insights now posts a summary comment on every pull request — failed jobs, flaky tests, execution time, and CI health at a glance." --- CI Insights now automatically posts a summary comment on every pull request, giving your team instant visibility into: - Failed jobs and flaky test detections - Total execution time and CI health - Quick insights without leaving the PR This helps reviewers and authors catch issues faster and understand CI behavior at a glance — without having to dig into external dashboards. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic247f2b37c5da8094839ae82fea6a1376png%7D) --- # Unknown \--- title: "Autoqueue option for queue rules" date: 2025-08-19 tags: - Merge Queue description: "New \`autoqueue\` field on \`queue\_rules\` automatically queues matching pull requests, removing the need for explicit \`queue\` actions." --- We’ve added a new \`autoqueue\` field to \`queue\_rules\`. When \`autoqueue: true\`, pull requests that match the rule’s conditions are \*\*automatically added to the merge queue\*\* during workflow processing. This removes the need to add explicit queue actions in your rules, reduces configuration complexity, and ensures PRs don’t get missed. By default, autoqueue is set to false to preserve current behavior. 📖 Learn more in the docs: \[Auto-queueing pull requests\](https://docs.mergify.com/merge-queue/rules/#autoqueueing-pull-requests). --- # Unknown \--- title: "Partition rules are now deprecated" date: 2025-07-28 tags: - Merge Queue description: "\`partition\_rules\` is deprecated — use \`queue\_rules\` instead. Existing configurations are being upgraded." --- The \`partition\_rules\` are now deprecated and configuration changes are being pushed to upgrade to \`queue\_rules\` instead. Partition support will be removed on 2025-10-31. --- # Unknown \--- title: "Test failure details in PR comments" date: 2025-09-04 tags: - CI Insights description: "CI Insights PR comments now include test-level details: failed tests, flaky test history, and links to investigate further." --- We’ve expanded the information included in PR comments from CI Insights. Previously, comments only reported \*\*job-level results\*\* (success, failure, retries). Now, they also include \*\*test-level insights\*\*: - Failed tests are listed directly in the PR comment. - Flaky tests are highlighted with their recent history. - Linked details let you jump into CI Insights for deeper investigation. This makes it easier for developers and reviewers to see exactly \*which tests\* failed without digging into raw CI logs — saving time and reducing context switching. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic264f2b37c5da800ea69fda55086de5d4png%7D) --- # Unknown \--- title: "Validate your configuration locally with a pre-commit hook" date: 2025-09-01 tags: - Rules description: "Mergify's official pre-commit hook validates your configuration locally before you push." --- You can now catch configuration errors before pushing by using \[Mergify’s official pre-commit hook\](https://docs.mergify.com/configuration/file-format/#validate-locally-with-pre-commit). --- # Unknown \--- title: "\`disallow\_checks\_interruption\_from\_queues\` has been deprecated" date: 2025-02-25 tags: - Merge Queue description: "The \`disallow\_checks\_interruption\_from\_queues\` option has been removed — use \`priority\_rules\` instead." --- The option \`disallow\_checks\_interruption\_from\_queues\` has been removed and is being replaced by \`priority\_rules\`. --- # Unknown \--- title: "Custom column display in CI Insights" date: 2025-09-16 tags: - CI Insights description: "Toggle column visibility in CI Insights tables — preferences persist locally and travel with the URL when shared." --- You can now toggle column visibility in CI Insights tables - Your preferences are saved locally, so hidden columns stay hidden when you come back. - Hidden columns are also stored in the URL, so you can share the exact same view with teammates. - New columns will always show up by default, even if you’ve hidden others. --- # Unknown \--- title: "Bypass the injection of rulesets conditions in the Merge Queue" date: 2025-11-20 tags: - Merge Protections - Merge Queue description: "Use the \`exempt\` bypass-actor mode for Mergify in your ruleset to skip injecting ruleset conditions into the Merge Queue." --- You can now bypass the injection of rulesets conditions in the Merge Queue conditions, by using the \`exempt\` mode for Mergify in the bypass actors settings of the ruleset. --- # Unknown \--- title: "Add/remove \`queued\` label automatically on PRs" date: 2025-09-24 tags: - Merge Queue description: "New \`queued\_label\` option on \`merge\_queue\` automatically tags pull requests as they enter and leave the queue." --- This pull request implements a new \`merge\_queue\` attribute name \`queued\_label\`. This attribute allows the user to set/unset the label that will be set on PRs that are either queued or dequeued in the merge queue. This makes it easier to spot queued PRs directly from the GitHub UI. --- # Unknown \--- title: "Dequeued label on PR" date: 2025-10-20 tags: - Merge Queue description: "New label for identifying dequeued pull requests" --- A label is now automatically toggled on PR removed from the merge queue. The label name is \`dequeued\` by default can be tweaked by using the \`dequeued\_label\` parameter in the \`merge\_queue\` section. \`\`\`javascript merge\_queue dequeued\_label: removed-from-queue \`\`\` --- # Unknown \--- title: "New \`glob\` operator for conditions in the configuration" date: 2025-10-31 tags: - Rules description: "Adds the \`\*=\` operator for glob-style pattern matching in conditions" --- You can now use the \`\*=\` operator in conditions to match values using glob patterns. This makes it easier to target branches, labels, or files that follow naming conventions or structured patterns. Examples: \`\`\`yaml - branch\_name \*= "release/\*" - label \*= "team-\*" - files \*= foobar/\*\*/\*.py \`\`\` --- # Unknown \--- title: "New changelog" date: 2025-11-07 tags: description: "New unified changelog experience 🚀" --- We’ve revamped how we share product updates! Our changelog now lives directly in the Mergify Docs, complete with an \[RSS feed\](https://docs.mergify.com/changelog/rss.xml), better categorization (Merge Queue, CI Insights, etc.). You’re reading it! If you’re using Slack, subscribe directly using \`/feed subscribe \`\[\`https://docs.mergify.com/changelog/rss.xml\`\](https://docs.mergify.com/changelog/rss.xml) --- # Unknown \--- title: "Improved Merge Queue status reporting (beta)" date: 2025-11-27 tags: - Merge Queue description: "Improved Merge Queue status updates now give clearer, real-time insights into PR progress." --- Mergify now provides \*\*richer, more informative status updates\*\* directly on your pull requests when they enter the Merge Queue. Instead of a single, static message, PRs now get \*\*step-by-step feedback\*\* about what’s happening: preparing the batch, waiting for CI, retrying, scheduled waits, and more. This gives developers clearer visibility into progress and removes the guesswork around “where is my PR?” This new reporting system is \*\*in beta\*\*, and we’re actively refining it. 👉 \*\*If you have feedback or ideas\*\*, please share them. It helps us improve the experience for everyone. --- # Unknown \--- title: "\`allow\_merging\_configuration\_change\` option is deprecated" date: 2024-01-26 tags: - Workflow Automation description: "Use \`-mergify-configuration-changed\` in your conditions instead — \`allow\_merging\_configuration\_change\` is deprecated." --- The option \`allow\_merging\_configuration\_change\` option is deprecated. If you still want to block queue or merge you need to add in your conditions: \`-mergify-configuration-changed\` --- # Unknown \--- title: "Merge queue intake statistics endpoint" date: 2026-03-13 tags: - Merge Queue - API description: "New API endpoint to track pull requests entering the merge queue over time" --- New API endpoint \`GET /v1/repos/{owner}/{repository}/stats/queues\_entered\_count\` that returns the count of pull requests entering the merge queue, grouped by time intervals. This endpoint supports filtering by base branch, partition, queue name, and priority rule. It enables building queue intake graphs and computing merge throughput rates by comparing entered vs merged pull requests. --- # Unknown \--- title: "New retry mode for failed jobs" date: 2026-01-28 tags: - CI Insights description: "CI Insights Auto Retry gets a new retry mode" --- Added workflow retry mode to Auto-Retry. When a job fails, you can now choose to retry the entire workflow instead of just the failed job. Useful when jobs have dependencies or shared state that requires a clean run. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic2f6f2b37c5da80df8dcedef4edd46ba5png%7D) --- # Unknown \--- title: "Automatic CI retries in merge queue" date: 2026-03-18 tags: - Merge Queue description: "You can now configure Mergify to automatically retry failed CI checks before removing a pull request from the queue." --- You can now configure Mergify to automatically retry failed CI checks before removing a pull request from the queue. This is useful for handling flaky CI, instead of immediately failing, Mergify will recreate the draft pull request to trigger a fresh CI run. To enable retries, set \`max\_checks\_retries\` in your queue rule. When set to a value greater than 0, Mergify will use draft pull requests (in-place checks are automatically disabled) and retry up to the configured number of times before applying the normal failure resolution. The queue status report shows the current attempt number (e.g., "attempt 2/3"). Defaults to 0 (no retries), preserving existing behavior. --- # Unknown \--- title: "Time-binned merge queue checks outcome endpoint" date: 2026-03-17 tags: - Merge Queue - API description: "New API endpoint to track dequeue reasons over time as a time-series graph" --- New API endpoint \`GET /v1/repos/{owner}/{repository}/stats/queues\_checks\_outcome\_count\` that returns dequeue reason counts grouped by time intervals. The existing \`merge\_queue\_checks\_outcome\` endpoint only returns aggregate totals (useful for pie charts). This new endpoint enables time-series graphs showing how dequeue reasons (e.g. CHECKS\_FAILED, MERGE\_QUEUE\_RESET, SUCCESS) evolve over time. The old endpoint is now deprecated. Supports filtering by base branch, partition, queue name, and priority rule. --- # Unknown \--- title: "Native RSpec Integration for Test Insights" date: 2026-04-07 tags: - Test Insights description: "RSpec projects can now use the rspec-mergify gem for automatic test result upload, flaky test detection, and flaky test prevention" --- Test Insights now natively supports RSpec through the rspec-mergify gem. Just add the gem to your Gemfile and set MERGIFY\_TOKEN in your CI — test results are uploaded automatically. The gem handles flaky test detection and prevention out of the box, with no JUnit XML generation or separate upload steps required --- # Unknown \--- title: "Deprecation of \`post\_check\` action" date: 2026-03-18 tags: - Deprecations - Merge Protections description: "Automatic migration of post\_check actions to merge\_protections entries" --- The \`post\_check\` action in \`pull\_request\_rules\` is being replaced by \`merge\_protections\`. A new transformer handles the migration automatically: ## What you need to do The transformer runs automatically and will open a pull request with the required changes. However, we recommend reviewing your configuration and migrating to \`merge\_protections\` explicitly, as the \`post\_check\` action will be removed in a future release. --- # Unknown \--- title: "Log pattern matching for auto-retry rules" date: 2026-03-23 tags: - CI Insights description: "Auto-Retry rules can now match against job log content to decide whether a failed job should be retried" --- A new \`log\_pattern\` condition is now available for Auto-Retry rules. When a CI job fails, Mergify can stream the job's logs and match them against regex patterns you define. This lets you target retries to specific, known transient failures — such as network timeouts or flaky infrastructure errors — instead of blindly retrying every failure. --- # Unknown \--- title: "The requeue command is deprecated" date: 2026-02-18 tags: - Merge Queue - Workflow Automation - Deprecations description: "The queue command can now requeue pull requests" --- The \`requeue\` command has been deprecated. Use \`@mergifyio queue\` instead to re-queue pull requests that were removed from the merge queue. ### What changed - \*\*\`@mergifyio queue\`\*\*\*\* now re-queues pull requests.\*\* After a pull request is dequeued for any reason (check failures, conflicts, timeouts, etc.), posting \`@mergifyio queue\` will re-queue it. - \*\*\`@mergifyio requeue\`\*\*\*\* still works\*\* but is now an alias for \`queue\`. No action is required immediately, but we recommend updating your workflows. ### Migration Replace any usage of \`@mergifyio requeue\` with \`@mergifyio queue\`. If you have automation rules using the \`requeue\` action, update them to use \`queue\`. --- # Unknown \--- title: "Merge Queue: PR exit reasons and idle time breakdown in stats" date: 2026-03-20 tags: - Merge Queue description: "New stats endpoints for the merge queue dashboard: PR exit reasons count (unique PRs by final exit reason) and idle time breakdown (capacity, schedule, freeze). Powers the new Sankey flow diagram and stacked time chart." --- Two new stats capabilities for the merge queue dashboard: \*\*PR Exit Reasons\*\* New visualization showing how pull requests flow through your merge queue — see at a glance how many PRs were merged successfully, cancelled, or failed, broken down over time. This powers the new Sankey flow diagram on the dashboard. \*\*Idle Time Breakdown\*\* Queue time stats now break down idle time into actionable categories: - \*\*Capacity\*\* — time spent waiting because the queue was at max parallel checks - \*\*Schedule\*\* — time spent waiting due to merge schedule restrictions - \*\*Freeze\*\* — time spent waiting because the queue was frozen This helps you understand where your merge queue time is actually spent and what to optimize. --- # Unknown \--- title: "\`rebase\` action with \`bot\_account\` on fork pull requests" date: 2026-04-07 tags: - Deprecations description: "The \`rebase\` action with \`bot\_account\` impersonation on fork pull requests is deprecated and will be removed on July 1, 2026." --- When using the \`rebase\` action on pull requests coming from forks, Mergify can impersonate a user via the \`bot\_account\` option to perform the rebase. This capability will be removed on July 1, 2026. After this date, the \`rebase\` action will no longer be able to rebase fork pull requests with this configuration. Please switch to the \`update\` action/command to ensure compatibility going forward. Affected pull requests will now receive a deprecation notice as a comment. --- # Unknown \--- title: "New \`scope\` attribute available for conditions" date: 2026-04-09 tags: - Merge Protections - Merge Queue - Workflow Automation description: "A new \`scope\` field is now exposed through pull requests attributes and can be used in conditions" --- A new \`scope\` field is now exposed through pull requests attributes and can be used in conditions. It contains the list of \`scopes\` associated with the pull requests. \[More informations about \](https://docs.mergify.com/merge-queue/scopes/)\[\`scopes\`\](https://docs.mergify.com/merge-queue/scopes/) --- # Unknown \--- title: "Fix quarantined tests with AI" date: 2026-10-05 tags: - Test Insights description: "Hand a quarantined test to Claude Code or Cursor with a ready-made prompt to fix it." --- On a quarantined test's details page, \*\*Fix with AI\*\* builds instructions for an AI coding assistant from what Mergify knows about the test: its file and function, the quarantine, its health history and its most recent failures. Copy them, or open them directly in Claude Code (in your local clone) or Cursor. --- # Unknown \--- title: "Parallel scopes" date: 2026-04-13 tags: - Merge Queue description: "Merge unrelated pull requests in parallel by grouping them into scopes based on the files they touch." --- Parallel Scopes lets the merge queue test and merge pull requests simultaneously when they affect different parts of your codebase. Define scopes through file patterns or your existing monorepo build system (Nx, Bazel, Turborepo), and Mergify will run an independent queue for each scope — while still serializing pull requests that share a scope to catch real conflicts. This dramatically reduces merge latency in monorepos where most changes are independent. Enable it by setting mode: parallel on your merge queue and declaring your scopes in the configuration. See the \[Parallel Scopes documentation\](https://docs.mergify.com/merge-queue/parallel-checks/) for details. --- # Unknown \--- title: "See how many CI runs each merged pull request costs" date: 2026-10-05 tags: - Merge Queue description: "The Merge Queue Stats page now shows how many CI runs the queue starts for each pull request it merges, and why the runs that led to no merge were thrown away." --- The new \*\*CI Runs per Merged PR\*\* widget on the Merge Queue Stats page shows the average number of CI runs the queue starts for each pull request it merges, and the share of those runs that led to no merge, broken down by why they were thrown away: a failure ahead in the queue, a higher-priority pull request, a retried check, and so on. A batch tested once counts as one run however many pull requests it carries, so you can see what \`batch\_size\`, \`max\_parallel\_checks\` and speculative checks actually cost you in CI. The same numbers are available from the statistics API and in Datadog as \`mergify.queue.ci\_runs.started\` and \`mergify.queue.ci\_runs.wasted\`. --- # Unknown \--- title: Jobs description: Track your CI job health, duration, and cost to identify flaky, broken, or expensive jobs before they slow down your team. --- The Jobs page helps you understand how your CI jobs behave over time. Spot flaky jobs, catch regressions in duration or failure rate, and keep track of where your CI budget goes. ![CI Insights Jobs](https://docs.mergify.com/ci-insights/%7BJobsScreenshot%7D) :::note Before using the Jobs page, you need to have CI Insights enabled on your repository. See the \[CI Insights setup guides\](/ci-insights) to get started. ::: ## Job Metrics The metrics view is the default landing page for CI Insights. It aggregates job performance across a time period so you can identify trends and outliers at a glance. Each job is assigned a \*\*health status\*\* (Healthy, Flaky, or Broken) based on its recent run history. This helps you quickly focus on jobs that need attention rather than sifting through individual runs. :::tip Group the metrics by branch to compare the same job on your default branch and on pull requests. Filters on job name, pipeline name, branch, and health narrow the list further. The repository selector at the top of the page covers every repository by default; pick a subset there to scope every metric below it. ::: ## Job Executions The executions view shows individual job runs with their status, duration, and cost. Use it to drill into specific failures, investigate flaky behavior, or trace a regression back to a particular commit. Clicking any execution opens a detail panel with the full job timeline and related test results. :::tip If a job started failing recently, filter by date range and sort by duration to see whether the failure correlates with a performance change. ::: ## Data Retention CI Insights keeps 30 days of job history. The free tier keeps only the last 24 hours, so a date range reaching further back returns nothing older than that rather than an error. Both views show a banner when your plan is on the shorter window. --- # Unknown \--- title: "Auto-merge setting in Merge Protections" date: 2026-04-21 tags: - Merge Protections - Deprecations description: "New auto\_merge setting that automatically merges or queues PRs when all merge protection conditions pass, replacing the deprecated autoqueue in queue rules." --- You can now add \`auto\_merge: true\` to \`merge\_protection\_settings\` to automatically merge PRs when all your merge protection \`success\_conditions\` are met. If the merge queue is enabled, PRs are queued automatically; without it, they are merged directly. This replaces \`autoqueue\` in \`queue\_rules\`, which is now deprecated and will stop working on July 16, 2026. If you currently use \`autoqueue\`, Mergify will automatically open a pull request to migrate your configuration. Note that \`auto\_merge\` applies globally to all queue rules, unlike \`autoqueue\` which was set per rule. --- # Unknown \--- title: CI Insights Setup – Buildkite description: Enable Mergify CI Insights and configure flaky test detection using Buildkite. --- This page explains how to enable CI Insights for a repository using Buildkite and how to configure repeated test executions for flaky test detection. ## Enabling CI Insights for Buildkite 1. Enable CI Insights for each repository you want it to cover, on the \[Repositories page\](https://dashboard.mergify.com/repositories) of the dashboard (\[docs\](/integrations/github#configuring-enabled-products)). 2. Create an application key with \`ci\` scope as described in the \[API Usage documentation\](/api/usage). This key will be used both for the webhook authentication and for uploading test reports. 3. Configure a webhook in Buildkite to send build and job events to Mergify. Go to your Buildkite \*\*Organization Settings\*\* → \*\*Integrations\*\* → \*\*Notification Services\*\* and add a new \*\*Webhook\*\* notification with the following settings: - \*\*Webhook URL\*\*: set it to: \`\`\`text https://api.mergify.com/v1/ci//repositories//buildkite/webhooks \`\`\` Replace \`\` with your Mergify organization name and \`\` with your repository name. - \*\*Token\*\*: paste your Mergify application key and select \*\*Send the token as X-Buildkite-Token\*\*. - \*\*Events\*\*: enable the two events Mergify records: | Event | Description | |-------|-------------| | \`build.finished\` | A build has finished | | \`job.finished\` | A job has finished | Any other Buildkite event reaching this webhook is accepted and discarded, so enabling more only adds traffic. ![Buildkite Webhook Notification configuration](https://docs.mergify.com/ci-insights/setup/%7BBuildkiteWebhookNotification%7D) 4. Make the application key available as \`MERGIFY\_TOKEN\` in the environment of your Buildkite agents, through an agent \`environment\` hook or a secrets plugin. The Buildkite plugin reads it from there to upload test reports. 5\. Click on \`CI Insights\` in the Mergify dashboard navigation. You should start seeing your Buildkite job runs appear: ![CI Insights Jobs](https://docs.mergify.com/ci-insights/setup/%7BJobsScreenshot%7D) ## Uploading Test Results Use the \[\`mergifyio/mergify-ci\`\](https://github.com/Mergifyio/mergify-ci-buildkite-plugin) Buildkite plugin to upload JUnit XML test reports: \`\`\`yaml steps: - label: "Run tests" command: pytest --junitxml=reports/junit.xml plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: junit-process report\_path: "reports/\*.xml" \`\`\` The plugin runs in the \`post-command\` hook, so your test command executes first, then the plugin uploads the results. Even if your tests fail, the results are still uploaded. The step carries no token: the plugin picks up \`MERGIFY\_TOKEN\` from the agent's environment, and fails the step if it is not there. For frameworks with native Mergify integration (e.g., \`pytest-mergify\`), no plugin is required: the reporter reads \`MERGIFY\_TOKEN\` from the same agent environment. ## Setting Up Flaky Test Detection To detect flaky tests, you need to run the same tests multiple times on the same code. This section explains how to set up your Buildkite pipeline for repeated test execution. ### Prerequisites Before setting up flaky test detection, ensure you have: 1. Enabled \[CI Insights\](#enabling-ci-insights-for-buildkite) for your repository 2. Created an application key with \`ci\` scope and set it as \`MERGIFY\_TOKEN\` in the environment of your Buildkite agents, \[not in the pipeline file\](#enabling-ci-insights-for-buildkite) 3. Configured test integration for your test framework ### Buildkite Setup Use a \[scheduled build\](https://buildkite.com/docs/pipelines/scheduled-builds) that runs your test suite multiple times on the default branch. Here's an example pipeline that runs tests with 5 repeated executions: \`\`\`yaml steps: - label: "Flaky test detection" command: | set +e failed=0 for i in $(seq $${RUN\_COUNT:-5}); do echo "--- Run $$i of $${RUN\_COUNT:-5}" pytest --junitxml=reports/junit-$$i.xml tests/ if \[ $$? -ne 0 \]; then failed=1 fi done exit $$failed plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: junit-process report\_path: "reports/\*.xml" \`\`\` Configure a schedule in your Buildkite pipeline settings to run this every 12 hours on weekdays. ### Configuration Tips - \*\*Frequency\*\*: Running twice daily (every 12 hours) provides a good balance between detection accuracy and resource usage - \*\*Default Branch Only\*\*: Focus on the default branch where flaky tests have the most impact - \*\*Weekday Schedule\*\*: Run Monday to Friday to avoid running when no changes are made to the code - \*\*Job name\*\*: CI Insights records the job a test ran in as part of that test's identity, so the scheduled step has to report the same job name as the step running those tests on your pull requests. Otherwise the two sets of results count as two different tests. By default that name is the step label. Set the plugin's \`job\_name\` option to report a different one: \`\`\`yaml steps: - label: "Flaky test detection" command: plugins: - mergifyio/mergify-ci#@@BUILDKITE\_PLUGIN\_VERSION@@: action: junit-process report\_path: "reports/\*.xml" job\_name: "Run tests" \`\`\` The plugin exports \`MERGIFY\_TEST\_JOB\_NAME\` itself before it uploads, from \`job\_name\` if you set it and from the step label otherwise, so a value put in the step's \`env\` is overwritten. That variable is still the way to rename the job when you upload without the plugin, from a framework with a native Mergify integration. ## Test Framework Configuration See the \[test framework guides\](/test-insights#test-framework-configuration) for framework-specific instructions on generating JUnit XML reports and uploading them with both GitHub Actions and Buildkite. --- # Unknown \--- title: Self-hosted runners description: Monitor the self-hosted CI runners behind your pipelines so you can spot capacity bottlenecks, degraded machines, and wasted spend. --- Self-hosted runners are the machines that execute your CI. Mergify doesn't provision or control them. It watches the jobs they run and turns that data into metrics about capacity, performance, cost, and reliability. That fleet is infrastructure you own and pay for, but it usually runs as a black box: you only hear about it once builds start queuing or failing. These metrics let you base scaling and reliability decisions on what the fleet actually does. :::note Self-hosted runners are part of CI Insights. Enable CI Insights on your repository first. See the \[setup guides\](/ci-insights) to get started. ::: ## Why monitor your runners The metrics answer a few recurring questions: - \*\*Is the fleet the right size?\*\* Idle runners mean you pay for capacity you don't use. Saturated runners mean jobs wait. Both are expensive, in different ways. - \*\*Is a runner degraded?\*\* One slow or flaky machine drags down every job scheduled on it, often without an obvious failure. - \*\*Where is CI time going?\*\* Time spent \*waiting\* for a runner and time spent \*running\* on it are different problems with different fixes. - \*\*What is the fleet costing?\*\* Cost per runner and per job shows where spend concentrates. ## What Mergify tracks Mergify groups these metrics into two areas. ### Queue: is work waiting for a runner? The queue tracks how long jobs wait to get a runner and how many are waiting, grouped by the labels they request. Read the two signals together: rising wait times with steady demand point to a capacity problem, so add runners; a spike in queued jobs points to a demand surge instead. The aim is to keep runners ahead of demand, before queue time starts delaying pull requests. Queues are the one part of this page you have to configure: they are grouped by the labels you record, and a job that requests only unrecorded labels is not counted. See \[Recording the labels you care about\](#recording-the-labels-you-care-about). ### Fleet: how is each runner performing? The fleet is your runners seen one at a time: throughput, speed, success rate, and how each runner compares to its peers. Each runner carries a health status, so an underperforming or unstable one is easy to single out. You can also follow each runner's trends over time and see how heavily it is being used. ![Self-hosted runners fleet view](https://docs.mergify.com/ci-insights/%7BRunnersScreenshot%7D) ## No runner setup required Once CI Insights is enabled, Mergify tracks your runners automatically. It works out what to monitor from the jobs it already sees: - \*\*A runner shows up once it's reused.\*\* Mergify holds off the first time a runner appears: a runner that only ever handles a single job is treated as ephemeral and left out. As soon as a runner picks up a second job, Mergify recognizes it as a persistent machine and starts tracking it. Only first attempts count: a job that a runner picks up as a re-run does not push it over the line. This keeps your dashboards free of the ephemeral runner identities that large fleets churn through. - \*\*Queues follow the same rule.\*\* A queue is the demand from every job that requests the same labels. A job's wait counts toward its queue only once the runner that picked it up has been reused, so ephemeral runners don't create one-off queues. ## Recording the labels you care about Runners need no configuration, but the labels do. Under \*\*Self-hosted Runners → Settings\*\*, the \*\*Runner Labels\*\* field lists the labels Mergify records; it suggests the ones it has seen in your CI events, and you add or remove them from there. Queue metrics are grouped by these labels, and a job that requests none of the recorded labels is not counted as demand at all. Until you record at least one label, a fleet whose jobs all specify \`runs-on\` labels produces no queue data. The Fleet view is unaffected: runners are tracked either way, and recording labels only adds the per-label breakdown. ## Key concepts - \*\*Runner groups and labels.\*\* Runners are organized into groups, and labels (the \`runs-on\` values a job requests) identify which kind of runner handled the work. Mergify uses the group to compare each runner against its peers. - \*\*Persistent runners only.\*\* This page tracks runners that get reused, not the ephemeral ones that run a single job. For those, use the \[Jobs\](/ci-insights/jobs) page. - \*\*Wait time vs. run time.\*\* Wait time is how long a job sits before a runner picks it up; run time is how long it executes once started. - \*\*Health status.\*\* Derived from a runner's success rate and its speed relative to its group, so machines that need attention surface on their own. :::note GitHub-hosted runners aren't monitored here. They use a new identity on every run, which makes per-runner metrics unreliable. ::: --- # Unknown \--- title: "Merge Queue failure rate statistics" date: 2026-03-11 tags: - API - Merge Queue description: "A new failure\_rate endpoint is available in the merge queue statistics API, returning the ratio of failed to total PRs leaving the queue, broken down by time intervals." --- The endpoint \`GET /repos/{owner}/{repository}/stats/failure\_rate\` returns the failure rate of pull requests in the merge queue, broken down by time intervals. Each interval includes: - \*\*total\*\*: the number of pull requests that left the queue - \*\*failures\*\*: the number of pull requests that were not merged - \*\*failure\_rate\*\*: the ratio of failures to total (between 0.0 and 1.0) Results are grouped by \*\*base branch\*\*, \*\*partition\*\*, \*\*queue\*\*, and \*\*priority rule\*\*, making it easy to identify which queues or branches have the highest failure rates. ## Filtering You can filter results using query parameters: - \`base\_ref\` — filter by target branch (e.g., \`main\`) - \`partition\_name\` — filter by partition - \`queue\_name\` — filter by queue name - \`priority\_rule\_name\` — filter by priority rule ## Use cases - Monitor merge queue health over time - Identify queues or branches with unusually high failure rates - Track the impact of CI or configuration changes on merge success --- # Unknown \--- title: "Automated migration for check interruption default change" date: 2026-04-21 tags: - Merge Queue description: "An automated configuration migration adds explicit \`allow\_checks\_interruption: true\` to priority rules with priority higher than medium, preparing for the upcoming default change." --- Priority rules with priority higher than medium that don't explicitly set \`allow\_checks\_interruption\` will receive an automated configuration pull request adding the explicit value. This preserves current behavior ahead of the default changing from \`true\` to \`false\`. The migration deadline is July 1, 2026. --- # Unknown \--- title: "API support for GitHub PAT" date: 2026-03-04 tags: - API description: "It’s possible for users to use the API" --- The Mergify API now support \[\*\*GitHub Personal Access Token \*\*\](https://docs.mergify.com/api-usage/#using-a-github-personal-access-token)\[for authentication\](https://docs.mergify.com/api-usage/#using-a-github-personal-access-token). --- # Unknown \--- title: "Batch bisection statistics API" date: 2026-03-12 tags: - Merge Queue - API description: "New API endpoint to track merge queue bisection events, helping users optimize their batch size configuration." --- Bisection is a key signal for batch size optimization: - \*\*Frequent bisections\*\* suggest the batch size may be too large, causing more CI failures and slower throughput - \*\*No bisections\*\* may indicate room to increase batch size for better merge velocity - \*\*Deep bisections\*\* (high depth) reveal that failures are hard to isolate, possibly due to flaky tests or complex interactions ## What's Tracked ### Bisection Start Events Emitted when a failed batch is split into sub-batches: - \*\*Batch size before split\*\* — how large the batch was when it failed - \*\*Number of sub-batches\*\* — how many pieces it was divided into - \*\*Bisection depth\*\* — 0 for the first split, increments for nested splits - \*\*Whether it's top-level\*\* — distinguishes root splits from recursive ones ### Bisection End Events Emitted when the culprit PR is identified: - \*\*Culprit PR numbers\*\* — which PR(s) caused the failure - \*\*Remaining PR numbers\*\* — PRs that were re-queued after culprit removal - \*\*Max failure resolution reached\*\* — whether the bisection hit the configured retry limit --- # Unknown \--- title: "Test Insights: mitigation" date: 2026-03-12 tags: - Test Insights description: "View quarantined tests on the default branch and turn auto-quarantine on so flaky tests don’t block merges." --- The Mitigation page is now available to everyone. It lists tests quarantined on the default branch (added manually or by auto-quarantine). You can enable auto-quarantine so Mergify automatically quarantines flaky tests when they fail repeatedly on the default branch, so they stop blocking merges while you fix or investigate them. The page shows which tests are quarantined and whether auto-quarantine is on or off. --- # Unknown \--- title: "Deprecation of action delete\_head\_branch" date: 2026-03-30 tags: - Deprecations description: "The \`delete\_head\_branch\` action is deprecated. " --- Use GitHub's native "\[Automatically delete head branches\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches)" repository setting instead. --- # Unknown \--- title: "New merge-batch merge method for merge queue" date: 2026-04-07 tags: - Merge Queue description: "A new merge-batch merge method merges the draft pull request prepared by the merge queue directly into the base branch" --- The merge queue now supports a new \`merge\_method: merge-batch\` option for queue rules. When enabled with \`batch\_size > 1\`, instead of merging each pull request individually, the merge queue merges its draft pull request directly using the GitHub merge API. The resulting merge commit clearly indicates it was performed by the merge queue, listing all included pull requests. This provides a cleaner merge history for teams using batch merging. --- # Unknown \--- title: "Match CI log patterns against check run annotations" date: 2026-03-30 tags: - CI Insights description: "Auto-retry log patterns now also match against GitHub check run annotations, not just log output." --- Auto-retry rules using \`log\_pattern\` conditions now automatically check GitHub check run annotations in addition to log output. This makes auto-retry detection more reliable for CI systems that surface errors through annotations. --- # Unknown \--- title: "Deprecation of queue\_branch\_merge\_method" date: 2026-04-01 tags: - Deprecations - Merge Queue description: "queue\_branch\_merge\_method is deprecated in favor of merge\_method: fast-forward, which now works in both inplace and draft-PR modes." --- The queue\_branch\_merge\_method setting is deprecated. Use merge\_method: fast-forward instead, which now works in both inplace and draft-PR modes. Existing configurations will be migrated automatically. --- # Unknown \--- title: "Test Insights: prevention and detection" date: 2026-03-11 tags: - Test Insights description: "Stop flaky tests from slowing you down. Prevention shows what gets caught before merge; Detection helps you find and fix the worst offenders." --- Two new pages to understand and improve flaky test management in your CI pipelines. \*\*Prevention\*\* tracks how effectively flaky tests are caught before they reach your main branch. See caught flakiness trends, monitor new tests being introduced, and understand CI time spent on reruns. \*\*Detection\*\* surfaces flaky and unhealthy tests across your repositories. Identify which tests are failing intermittently, how often reruns occur, and prioritize fixes based on impact. --- # Unknown \--- title: "Regex tester for auto-retry log patterns" date: 2026-04-14 tags: - CI Insights description: "Test your regex patterns against sample log lines directly in the auto-retry rule builder." --- You can now test your log patterns before saving them. When configuring auto-retry rules, a new "Test your log patterns" section lets you paste a sample log line and instantly see whether it matches any of your defined regex patterns. This helps you validate patterns before they go live, reducing trial-and-error. --- # Unknown \--- title: "Merge queue rebase with update\_bot\_account on fork pull requests" date: 2026-04-21 tags: - Deprecations description: "Using the merge queue with \`update\_method=rebase\` and \`update\_bot\_account\` on fork pull requests is deprecated and will be removed on July 1, 2026." --- When a fork pull request is queued with \`update\_method=rebase\` and \`update\_bot\_account\`, Mergify uses git-based rebase with user impersonation to update the branch. This capability will be removed on July 1, 2026. To avoid disruption, switch to \`update\_method=merge\` in your queue rule. Affected pull requests will now receive a deprecation notice as a comment. --- # Unknown \--- title: "Buildkite support for CI Insights" date: 2026-04-22 tags: - CI Insights description: "Connect your Buildkite pipelines to Mergify CI Insights to track build and job performance alongside your GitHub Actions and Jenkins data." --- Mergify CI Insights now supports Buildkite as a CI provider. Configure a Buildkite organization webhook pointing to Mergify and paste your CI application key as the webhook token — build and job events will automatically appear in your CI Insights dashboards alongside GitHub Actions and Jenkins. --- # Unknown \--- title: "\`unqueue\` command alias removed" date: 2026-05-05 tags: - Workflow Automation description: "The deprecated \`unqueue\` command alias has been removed; use \`dequeue\` instead." --- The \`@Mergifyio unqueue\` command no longer works. It was renamed to \`@Mergifyio dequeue\` in November 2023 and has been kept as an alias since then. If you still have automation or comments relying on \`unqueue\`, switch to \`dequeue\`. --- # Unknown \--- title: "Automatic migration from \`autoqueue\` to \`auto\_merge\_conditions\`" date: 2026-05-06 tags: - Merge Queue description: "Mergify now opens a migration PR that converts the deprecated \`queue\_rules\[\].autoqueue\` setting to the new \`merge\_protection\_settings.auto\_merge\_conditions\`." --- The \`queue\_rules\[\].autoqueue\` field has been deprecated in favor of \`merge\_protection\_settings.auto\_merge\_conditions\`. Mergify now opens a migration PR that rewrites your configuration automatically. Mixed setups — where only some queues had \`autoqueue: true\` — are translated into the equivalent \`auto\_merge\_conditions\`, with a YAML comment marking the queues that remain manual-only and reachable via the \`/queue\` command. --- # Unknown \--- title: "\`conditions\` in queue rules is deprecated" date: 2026-05-06 tags: - Deprecations - Merge Queue description: "The \`conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`merge\_conditions\` instead." --- The \`conditions\` attribute in queue rules has been replaced by \`merge\_conditions\`. Rename \`conditions\` to \`merge\_conditions\` in your \`.mergify.yml\` to migrate before the legacy attribute is removed on 2026-07-31. --- # Unknown \--- title: "Declarative \`commit\_message\_format\` for merge commits" date: 2026-05-06 tags: - Merge Queue - Workflow Automation description: "Configure merge commit titles, bodies, and trailers declaratively without writing Jinja2 templates." --- A new \`commit\_message\_format\` option lets you control merge commit content with a simple declarative config: pick \`inherit\` or \`pr-title\` for the title, \`inherit\`, \`pr-body\`, or \`empty\` for the body, and opt into trailers like \`co-authored-by\`, \`approved-by\`, or \`merged-by\`. Use \`inherit\` to defer to GitHub's repository-level "default commit message" setting. Available on queue rules, the \`merge\` action, and \`defaults\`. The existing \`commit\_message\_template\` keeps working unchanged. --- # Unknown \--- title: "\`routing\_conditions\` in queue rules is deprecated" date: 2026-05-06 tags: - Deprecations - Merge Queue description: "The \`routing\_conditions\` attribute in queue rules is deprecated and will be removed on 2026-07-31 — use \`queue\_conditions\` instead." --- The \`routing\_conditions\` attribute in queue rules has been replaced by \`queue\_conditions\`. Rename \`routing\_conditions\` to \`queue\_conditions\` in your \`.mergify.yml\` to migrate before the legacy attribute is removed on 2026-07-31. --- # Unknown \--- title: "Configure merge queue commit message format from the dashboard" date: 2026-06-02 tags: - Merge Queue description: "A new modal editor lets you configure the declarative commit\_message\_format for queue rules directly from the dashboard." --- When editing a queue rule from the dashboard, you can now configure how Mergify formats merge commits — title source, body content, and trailers — through a dedicated editor. This replaces hand-writing the legacy \`commit\_message\_template\` and keeps queue rule configuration entirely within the UI. --- # Unknown \--- title: "Isolated merge queue mode" date: 2026-06-02 tags: - Merge Queue description: "A new \`isolated\` merge queue mode runs every batch as a fully independent car, so a failure or delay in one batch never blocks the others." --- Set \`merge\_queue.mode\` to \`isolated\` to run every batch as a fully isolated car, with no dependency on any other batch. Unrelated changes no longer wait on each other: a batch that fails or stalls no longer holds up the rest of the queue. --- # Unknown \--- title: "Mergify Stacks adoption in the dashboard" date: 2026-06-02 tags: - API description: "See how your team is using Mergify Stacks — install commands to share, plus a live adoption page with active stacks, repos using it, and trends over time." --- Mergify Stacks now has a dashboard surface. The new \*\*Setup\*\* tab gives you install commands and an AI-coding-agent prompt you can hand straight to your team, while the new \*\*Adoption\*\* tab shows active stacks, which repos are using Stacks, and trends over time across your organization. All actions still happen on GitHub or via the CLI; the dashboard is read-only. Stacks itself remains zero-setup: no GitHub App, no dashboard auth required to use it. --- # Unknown \--- title: "Dynamic merge queue batch size" date: 2026-06-19 tags: - Merge Queue description: "Configure batch\_size as a {min, max} range and the merge queue scales batch size automatically — small when quiet, larger to absorb backlog." --- You can now set \`batch\_size\` to a \`{min, max}\` range instead of a fixed number. When the queue is quiet, Mergify keeps batches at \`min\` for the smallest possible blast radius; when pull requests pile up and all parallel-check slots are busy, it grows batches toward \`max\` to drain the backlog faster. Existing fixed \`batch\_size\` values keep working unchanged. --- # Unknown \--- title: "Impersonate the pull request author with a static \`{{ author }}\` bot account" date: 2026-06-19 tags: - Rules description: "\`{{ author }}\` is now a static \`bot\_account\` value that impersonates the pull request author in every action and queue rule, accepted anywhere." --- Set any \`bot\_account\` (or \`merge\_bot\_account\` / \`update\_bot\_account\`) to \`{{ author }}\` to act on behalf of the pull request's author. Mergify now treats it as a static value rather than a Jinja2 template, so it works consistently across all actions and queue rules, and appears as a "Pull request author" choice in your configuration. Jinja2 templating in these fields is being deprecated in favor of this static form. --- # Unknown \--- title: "Built-in author and merger options for assignee fields" date: 2026-06-19 tags: - Rules description: "The assign, copy, and backport actions now accept {{ author }} (and {{ merged\_by }} for copy/backport) as named, built-in options for their assignee lists." --- You can now assign pull requests to their author with the \`{{ author }}\` option — and, in \`copy\` and \`backport\`, to the user who merged the original pull request with \`{{ merged\_by }}\`. The dashboard offers them as named choices ("Pull request author" and "User who merged the pull request"), and existing configurations keep working unchanged. --- # Unknown \--- title: "Mention assignees and approvers in comment, review, and close messages" date: 2026-06-29 tags: - Workflow Automation description: "The comment, review, and close actions can now reference a pull request's assignees and approvers as ready-to-use @-mentions in their messages." --- Use the new \`{{ assignees }}\` and \`{{ approvers }}\` variables in your \`comment\`, \`review\`, and \`close\` action messages to @-mention a pull request's assignees and the people who approved it (for example, \`@alice, @bob\`). They're part of Mergify's new safe message-templating engine. Plain \`{{ variable }}\` placeholders keep working, but richer Jinja2 expressions in these fields are now deprecated and will stop working in a future release — for example: - \`@{{ assignee | join(', @') }}\` → use \`{{ assignees }}\` - \`@{{ approved\_reviews\_by | join(', @') }}\` → use \`{{ approvers }}\` - filters and logic like \`{{ author | upper }}\` or \`{% for ... %}\` are no longer supported --- # Unknown \--- title: "Auto-retry rules are now scoped per repository" date: 2026-06-02 tags: - CI Insights description: "Auto-retry rules are now managed per repository instead of organization-wide, with a repository selector at the top of the page." --- Auto-retry rules now belong to a single repository instead of applying organization-wide. Pick a repository from the selector at the top of the auto-retry page to view, create, edit, or delete rules scoped to it. The \`repository\` condition no longer needs to be added to each rule — the scope is set by the selector itself. --- # Unknown \--- title: "Slack notifications for quarantined tests" date: 2026-06-19 tags: - Test Insights description: "Mergify can now post a Slack message whenever a test is quarantined or dequarantined, so your team sees mitigation activity in real time." --- Subscribe any Slack channel to test quarantine activity from \*\*Integrations → Slack\*\*. Mergify posts a message whenever a test is quarantined or dequarantined — by a teammate or automatically — with a link to the test, who made the change, the test's current health status, and the reason it was quarantined. Choose the repositories and events each channel follows. --- # Unknown \--- title: "Safe templating for backport and copy titles & bodies" date: 2026-06-29 tags: - Workflow Automation description: "The copy and backport actions' title and body now use Mergify's safe {{ variable }} templating, and Jinja2 expressions in these fields are deprecated." --- The \`title\` and \`body\` of the \`copy\` and \`backport\` actions now render with Mergify's safe message-templating engine: literal text plus allowlisted \`{{ variable }}\` placeholders, with no expression evaluation. Plain \`{{ variable }}\` placeholders keep working, but richer Jinja2 in these fields — filters, loops, and \`{% … %}\` logic (for example \`{{ title | upper }}\` or \`{% for … %}\`) — is now deprecated and will stop working in a future release. --- # Unknown \--- title: "commit\_message\_template is deprecated — use commit\_message\_format" date: 2026-07-08 tags: - Deprecations description: "The commit\_message\_template setting is deprecated in favor of the declarative commit\_message\_format and will be removed on September 30, 2026." --- The Jinja2-based \`commit\_message\_template\` setting (on both the \`merge\` action and \`queue\_rules\`) is now deprecated in favor of the declarative \[\`commit\_message\_format\`\](https://docs.mergify.com/workflow/actions/merge#customizing-the-commit-message). Mergify shows a deprecation notice whenever the setting is used, and it will be removed on \*\*September 30, 2026\*\*. For the common merge-commit shapes, the equivalent \`commit\_message\_format\` settings are documented in the \[migration guide\](https://docs.mergify.com/workflow/actions/merge#migrating-from-commit\_message\_template). --- # Unknown \--- title: "Mark a pull request as impacting all CI scopes" date: 2026-07-08 tags: - Merge Queue description: "Report a pull request as impacting every CI scope so it serializes the merge queue, instead of enumerating every target." --- When a pull request changes something that affects your whole build — CI or build-system configuration, for example — you can now mark it as impacting \*\*all scopes\*\* instead of listing every target. Mergify treats such a pull request as a merge-queue barrier: it runs on its own, and everything queued after it waits for it, so a sweeping change can't slip through a parallel lane. Report it from CI with the scopes API (an explicit \`all\_scopes\` flag alongside the usual scope list), and see it highlighted in the merge-queue view. --- # Unknown \--- title: Using Slack with Mergify description: Learn how you can send Slack notifications for Merge Queue events, CI Insights, Test Insights quarantine activity, and pull request activities. --- Mergify's Slack integration sends notifications about your development workflow directly to Slack. You can get updates about Merge Queue activities, CI job completions, test quarantine activity, and pull request events. ## Setting Up the Mergify Slack Integration Before configuring specific notifications, you need to connect your Slack workspace to Mergify: 1. Go to your Mergify dashboard 2. Navigate to \*\*Integrations → Slack\*\* 3. Follow the prompts to connect your Slack workspace 4. Authorize the Mergify app for your Slack workspace Once connected, you can configure different types of notifications based on your team's needs. ## Merge Queue Notifications Get real-time updates about your Merge Queue activities directly in Slack channels. Merge Queue notifications cover: - Pull requests entering the queue - The queue starting and finishing checks for a pull request - Pull requests leaving the queue, and pull requests merged out of it - Queue \[pauses\](/merge-queue/pause) being created, updated, or deleted - \[Scheduled freezes\](/merge-protections/freeze) being created, updated, or deleted To set up Merge Queue notifications: 1. In your Mergify dashboard, go to \*\*Integrations → Slack\*\* 2. Select the Slack channel where you want to receive Merge Queue notifications 3. Choose the repositories you want to monitor 4. Configure notification preferences (all events or specific events only) ![Merge Queue activity on Slack](https://docs.mergify.com/integrations/%7BmqCommentSlack%7D) Those notifications are useful for: - \*\*Team Coordination\*\*: Keep the entire team informed about merge activities - \*\*Release Management\*\*: Monitor critical merges during release periods - \*\*Debugging\*\*: Quickly identify when and why queue operations fail ## CI Insights Notifications \[Mergify's CI Insights\](/ci-insights) can send Slack notifications about CI job completions, allowing your team to stay informed about build statuses, test failures, and deployment activities. A CI Insights notification is posted when a job finishes, and contains: - \*\*Job and pipeline\*\*: the job name, linked to the job in your CI, and the pipeline it belongs to - \*\*Repository and branch\*\*: the repository, linked to GitHub, and the branch the job ran on - \*\*Conclusion\*\*: how the job ended, with a matching emoji, when it finished, and how long it took - \*\*Pull request\*\*: the pull request the job ran on, when there is one - \*\*A link to CI Insights\*\*: a button opening that job's executions in the Mergify dashboard To configure CI Insights Slack notifications: 1. \*\*Enable CI Insights\*\*: Make sure you have \[CI Insights enabled\](/ci-insights) for your repositories 2. \*\*Configure Notifications\*\*: In your Mergify dashboard, navigate to \*\*Integrations → Slack\*\* 3. \*\*Set Up Rules\*\*: Configure notification rules based on your criteria ![Slack integration with CI Insights](https://docs.mergify.com/integrations/%7BciInsightsConfig%7D) ### Notification Criteria You can filter notifications on: - \*\*Repository\*\*: the repositories to watch - \*\*Branch\*\*: the branches the job ran on - \*\*Pipeline\*\*: the pipelines or workflows the job belongs to - \*\*Job\*\*: the job names - \*\*Job conclusion\*\*: \`action\_required\`, \`cancelled\`, \`failure\`, \`neutral\`, \`skipped\`, \`success\`, or \`timed\_out\` Each filter is a list of exact values picked from what CI Insights has already recorded, and leaving one empty means "all". Wildcards and patterns are not supported: a job matches only when its branch, pipeline, job name, and conclusion are among the values you selected, so a release branch has to be listed by name rather than as \`release/\*\`. ### Example Configurations #### Critical Failures Only Monitor failures on the main branch for production-related jobs: - Repository: \`your-org/your-repo\` - Branch: \`main\` - Job conclusion: \`failure\` - Job: \`deploy\`, \`security-scan\`, \`integration-tests\` #### Release Monitoring Monitor successes and failures on the release branches you are shipping from, each one listed by name: - Repository: \`your-org/your-repo\` - Branch: \`release/2026.1\`, \`release/2026.2\` - Job conclusion: \`failure\`, \`success\` #### Test Failure Alerts Alert on failures of your test jobs across all branches, leaving the branch filter empty: - Repository: \`your-org/your-repo\` - Job conclusion: \`failure\` - Job: \`unit-tests\`, \`integration-tests\` ### Best Practices 1. \*\*Start Broad, Then Narrow\*\*: Begin with broader notifications and gradually add filters to reduce noise 2. \*\*Use Separate Channels\*\*: Consider different Slack channels for different types of notifications (e.g., #ci-failures, #deployments, #security-alerts) 3. \*\*Focus on Critical Paths\*\*: Prioritize notifications for jobs that affect production deployments or security 4. \*\*Monitor Flaky Tests\*\*: CI Insights notifications cannot filter on flaky tests. Use the Test Insights notifications below, which fire when a test is quarantined or dequarantined 5. \*\*Team-Specific Filters\*\*: Configure different notification rules for different teams based on their responsibilities ## Test Insights Notifications \[Mergify's Test Insights\](/test-insights) can post a Slack message whenever a test is \[quarantined or dequarantined\](/test-insights/quarantine), so your team sees mitigation activity as it happens (whether a teammate acted from the dashboard or CLI, or Mergify quarantined the test automatically). Test Insights notifications include: - \*\*Test\*\*: The affected test, linked to its details page - \*\*Repository\*\*: The repository the test belongs to - \*\*Action\*\*: Whether the test was quarantined or dequarantined - \*\*Source\*\*: Who acted: a teammate or Mergify's automatic quarantine - \*\*Health status\*\*: The test's health at the time of the event - \*\*Reason\*\*: Why the test was quarantined (on quarantine events) To configure Test Insights Slack notifications: 1. \*\*Enable Test Insights\*\*: Make sure you have \[Test Insights\](/test-insights) set up for your repositories 2. \*\*Connect Slack\*\*: In your Mergify dashboard, navigate to \*\*Integrations → Slack\*\* 3. \*\*Add the notification\*\*: On a channel, add a \*\*Test Insights\*\* notification, then choose the repositories to monitor and which events (quarantine, dequarantine) to subscribe to Test Insights notifications are available on the same plans as the \[quarantine feature\](/test-insights/quarantine). ## Pull Request Notifications via GitHub-Slack Integration In addition to native Mergify notifications, you can also receive Slack notifications based on Mergify actions by using the GitHub to Slack integration. ### Setting Up GitHub-Slack Integration 1. Go to \[Slack's GitHub Integration page\](https://slack.github.com/) 2. Click on the \`Add to Slack\` button 3. Invite the GitHub app to the channel you want. Refer to the \[documentation\](https://github.com/integrations/slack/blob/master/README.md) for more details 4. Make sure you subscribe to the repositories \[to receive the mentions\](https://github.com/integrations/slack/blob/master/README.md#mentions) as private message for the GitHub Slack app ### Using Mergify's Comment Action with Slack Notifications You can use Mergify's \[comment action\](/workflow/actions/comment/) to mention users in PR comments, which will trigger Slack notifications if the user has GitHub integrated with Slack. Here's an example that notifies the PR author when CI fails on hotfix PRs: \`\`\`yaml pull\_request\_rules: - name: Notify author on CI failure for hotfixes conditions: - "#check-failure > 0" - "label = hotfix" actions: comment: message: "@{{author}} :warning: The CI failed on this hotfix PR. Please review the issues and address them." \`\`\` This rule: - Checks for CI failures with \`#check-failure > 0\` - Ensures the PR has the \`hotfix\` label - Comments mentioning the PR author using \`@{{author}}\` - Triggers a Slack notification if the author has GitHub-Slack integration enabled ### Use Cases - \*\*Critical PR Alerts\*\*: Notify authors about urgent issues with hotfix or release PRs - \*\*Review Requests\*\*: Automatically mention reviewers when PRs are ready - \*\*Status Updates\*\*: Keep stakeholders informed about important PR milestones ## Troubleshooting If you're not receiving expected notifications: 1. \*\*Check Integration Status\*\*: Verify that Slack integration is properly connected in your Mergify dashboard 2. \*\*Review Notification Settings\*\*: Ensure your notification rules are correctly configured 3. \*\*Verify Channel Permissions\*\*: Make sure the Mergify Slack app has permission to post in your target channels 4. \*\*Test with Broader Filters\*\*: Temporarily use broader criteria to confirm the integration is working 5. \*\*Check Repository Access\*\*: Ensure Mergify has access to the repositories you want to monitor --- # Unknown \--- title: Deploying your Merge Queue description: Deploy Mergify's merge queue with a hybrid approach or enforce exclusive automated merges. --- Once you've configured your merge queue, you can deploy it using one of two approaches: \*\*Approach 1: Hybrid Mode.\*\* Mergify and manual merges coexist. This is the simplest way to start and requires no additional setup. \*\*Approach 2: Exclusive Mode.\*\* Only Mergify can merge pull requests (enforced via GitHub rulesets). This provides the most consistent workflow. Both approaches are optional: choose what works best for your team. ## Approach 1: Hybrid Mode In hybrid mode, developers can use the merge queue or merge manually. Both work simultaneously. This is the default behavior and requires no setup. ### When to Use Hybrid Mode - \*\*Getting started\*\*: Your team is new to merge queues - \*\*Gradual transition\*\*: You want minimal disruption to existing workflows - \*\*Flexibility\*\*: Some PRs need manual merging for specific reasons ### Tradeoffs - \*\*Queue disruption\*\*: Manual merges can interrupt the automated queue flow - \*\*Extra CI time\*\*: Manual merges may reset queued jobs, increasing CI usage (disable with \`reset\_on\_external\_merge: never\`) ### Best Practices \*\*Educate your team\*\* on when to use the queue vs. manual merges. \*\*Monitor usage\*\* to track adoption. Add this rule to get notified of manual merges: \`\`\`yaml pull\_request\_rules: - name: notify on manual merge conditions: - merged - merged-by != mergify\[bot\] actions: comment: message: Hey @{{author}}, this PR was merged manually. Consider using the merge queue next time! \`\`\` \*\*Gather feedback\*\* from your team and address any issues they encounter. ## Approach 2: Exclusive Mode In exclusive mode, only Mergify can merge pull requests. This is enforced using GitHub rulesets and provides the most consistent, automated workflow. ### When to Use Exclusive Mode - \*\*Your team is comfortable\*\* with the merge queue - \*\*You want consistency\*\*: All PRs follow the same automated process - \*\*Optimal performance\*\*: Eliminates queue disruptions from manual merges ### How to Enable Exclusive Mode 1. Navigate to \*\*Merge Queue > Deployment\*\* in your Mergify dashboard. ![Deploy screen from Mergify dashboard](https://docs.mergify.com/merge-queue/%7BbpDashboardScreenshot%7D) 2. Follow the on-screen instructions to configure your GitHub ruleset. When you set Mergify's bypass mode on that ruleset, choose \*\*Exempt\*\* if you queue \[GitHub-native stacked pull requests\](/merge-queue/stacks#github-native-stacked-pull-requests): the merge queue refuses them under any other mode, \*\*Always allow\*\* included. See \[Bypass Actors\](/merge-queue/github-rulesets#bypass-actors) for what each mode covers. 3. Click the verification button to confirm your setup is correct. \*\*Be careful\*\*: Mergify injects the ruleset's rules into the merge queue as conditions. The bypass mode you give Mergify only decides what GitHub lets it \*do\*. What Mergify \*requires\* before merging is controlled separately, by \[\`branch\_protection\_injection\_mode\`\](/merge-queue/github-rulesets#controlling-injection) on your queue rules. See \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets) for bypass modes and known incompatibilities. ### Enforcing Exclusive Mode with Classic Branch Protection Rulesets are the recommended way to enforce exclusive mode. If your repository still uses classic branch protection instead, you can achieve the same result by restricting who may push to your protected branch to Mergify only. 1. In your repository, open \*\*Settings > Branches\*\* and click \*\*Add branch protection rule\*\*. ![GitHub branch protection settings](https://docs.mergify.com/merge-queue/%7BbpSettingsScreenshot%7D) 2. Enter your branch name, enable \*\*Restrict who can push to matching branches\*\*, and add the \*\*Mergify\*\* app to the allowed list. ![Restrict push access to Mergify](https://docs.mergify.com/merge-queue/%7BbpRuleScreenshot%7D) With this rule in place, developers can no longer merge pull requests directly, so all merges flow through Mergify's queue. --- # Unknown \--- title: Creating Stacks description: Walk through creating your first stack of pull requests. --- This guide walks you through creating a stack from scratch, from starting a branch to having multiple chained PRs on GitHub. ## Start a New Branch Use the \`stack new\` command to create a branch that tracks your main branch: \`\`\`bash mergify stack new feat/my-feature \`\`\` This is equivalent to \`git checkout -b feat/my-feature --track origin/main\`. You can also create branches however you normally do. Stacks doesn't require its own branch creation command. To branch from something other than \`main\` (a release branch, for example): \`\`\`bash mergify stack new feat/my-feature --base origin/release-v2 \`\`\` ## Make Commits Work normally. Each commit should represent one logical unit of work, something that makes sense to review on its own. For example, building a new API feature: \`\`\`bash # First commit: data model git add src/models/user.py git commit -m "feat: add user data model Define the User schema with fields for auth." # Second commit: API endpoint git add src/api/users.py git commit -m "feat: add user registration endpoint POST /api/users creates a new user account." # Third commit: tests git add tests/test\_users.py git commit -m "test: add user registration tests Cover happy path, duplicate email, and validation errors." \`\`\` Each commit automatically gets a \`Change-Id\` trailer. You don't need to do anything special. ## Push the Stack Run: \`\`\`bash mergify stack push \`\`\` What happens behind the scenes: 1. \*\*Rebases\*\* your branch on the latest \`main\`, unless a PR in the stack is already approved and the rebase would dismiss the review (see \[Updating Stacks\](/stacks/updating)) 2. \*\*Creates a remote branch\*\* for each commit 3. \*\*Opens a PR\*\* for each commit, chained in dependency order 4. \*\*Posts a stack comment\*\* on every PR showing the full stack 5. \*\*Registers the stack\*\* with GitHub's stacking API, so GitHub shows it as a stack of its own and holds the ordering. Pass \[\`--no-github-native\`\](/stacks/setup#configuration) to push without this and get a \[\`Depends-On:\` chain\](/merge-queue/stacks#mergify-stacks) instead, which the \[Merge Queue\](/merge-queue/stacks) moves as a unit just the same The full flow, from setup to push: ![Terminal showing mergify stack setup, new, and push](https://docs.mergify.com/stacks/%7BsetupNewPush%7D) The result on GitHub: three small, focused PRs instead of one large one. Each PR contains exactly one commit's worth of changes. Each PR includes a stack comment that shows where it sits in the chain: ![Stack comment showing PR position in the chain](https://docs.mergify.com/stacks/%7BStackComment%7D) ## Check Your Stack To see the state of your stack at any time: \`\`\`bash mergify stack list \`\`\` This shows each PR, its CI and review status, and a link to GitHub: ![Terminal output of mergify stack list](https://docs.mergify.com/stacks/%7BstackList%7D) :::tip Use \`mergify stack open\` to quickly open a PR in your browser. Name a commit to open its PR; run it without one from a terminal and you get an interactive picker with \`HEAD\` preselected. ::: ## Next Steps To update a commit after code review, see \[Updating Stacks\](/stacks/updating). For a reviewer's perspective on navigating stacked PRs, see \[Reviewing Stacks\](/stacks/reviewing). --- # Unknown \--- title: Monitoring your Merge Queue description: Monitor key metrics of your merge queue to improve throughput and reduce latency. --- The Mergify dashboard reports how your merge queue has performed over time, and the Mergify CLI reports what it is doing right now. ## The Statistics Page Open \*\*Merge Queue → Statistics\*\* in your \[dashboard\](https://dashboard.mergify.com) to see how your queue is behaving: ![Statistics page on Mergify's dashboard](https://docs.mergify.com/merge-queue/%7BdashboardStatsScreenshot%7D) Use the date picker to select the time range you want to review. Presets go up to "Past 3 months". Queue data is retained for 90 days: the calendar will not let you pick a day older than that, and the oldest day or two of the longest preset can come back empty. Three controls apply to every widget on the page at once: - The \*\*repository selector\*\* chooses which repository the page reports on. - \*\*Filters\*\* restrict the data to a set of branches, \[queue rules\](/merge-queue/rules), or \[priority rules\](/merge-queue/priority). - \*\*Breakdown\*\* keeps all the data but splits each chart into one series per branch, queue rule, or priority rule, so you can compare them side by side. Clicking a series narrows the page down to it. \*\*Max Running Checks\*\* is the one widget that cannot be broken down by priority rule: a running check covers a batch of pull requests that may come from different priority rules, so it cannot be attributed to a single one. A row of headline figures sits at the top: pull requests entered and merged, the merged rate, the share of queue time spent waiting for CI capacity, max queue size, throughput, queue time, CI runtime, and CI failure rate. Below it, the widgets are grouped into three sections. ### Queue Health Exit reasons, interruptions, and failure trends. - \*\*PR Exit Reasons\*\*: how pull requests leave the queue. The distribution view counts each pull request once by its final exit reason; the over-time view shows how those reasons trend. - \*\*Batch Outcomes\*\*: the outcome of every CI run the queue triggered, including batch results, \[bisection\](/merge-queue/batches#handling-batch-failure-or-timeout) attempts, and queue resets. One pull request can produce several runs. - \*\*Checks Retries\*\*: how often checks are retried, and how often a retry ends in a merge. A low recovery rate points at genuinely broken tests rather than flaky ones. - \*\*CI Failure Rate\*\*: the share of queue exits caused by a proven CI failure (checks that failed, and checks that ran out of the queue's \[checks timeout\](/merge-queue/lifecycle#checks-timeout)). Every other exit, a merge included, counts in the total but not as a failure. Exits that prove nothing about your CI are deliberately left out of the numerator: a \[check interrupted before producing a result\](/merge-queue/lifecycle#interrupted-checks), and a pull request dropped untested by \[bisection\](/merge-queue/batches#handling-batch-failure-or-timeout). A rising rate usually means flaky tests, unstable CI, or problematic changes being queued. - \*\*Batch Bisection Count\*\*: how often Mergify had to split a failing batch to find the culprit. A high count means batches are failing often. ### Throughput Volume of pull requests processed and queue capacity. - \*\*Entered PRs\*\* and \*\*Merged PRs\*\*: how many pull requests joined and left the queue over time. Sudden drops or spikes are worth investigating. - \*\*Max Queue Size\*\*: the largest the queue got. The reference line marks your max checks capacity (max batch size × \[\`max\_parallel\_checks\`\](/merge-queue/performance#parallel-checks)), so a queue above the line means pull requests are waiting for a free check slot. - \*\*Average Batch Size\*\*: the reference line shows the largest \[\`batch\_size\`\](/merge-queue/batches) configured across your queue rules. Sitting at the maximum suggests the queue is saturated. - \*\*Max Running Checks\*\*: peak concurrent checks. The reference line is your effective \`max\_parallel\_checks\` (the configured value, or the default when it is unset). If you are often at that line, raising \`max\_parallel\_checks\` improves throughput. ### Performance Queue timing and CI execution speed. - \*\*Time Breakdown\*\*: how a pull request's time in queue splits across waiting for CI capacity, \[schedule\](/configuration/data-types#schedule) windows, \[freeze\](/merge-protections/freeze) periods, and CI runtime. Switch each component between \*\*Avg\*\*, \*\*P95\*\*, and \*\*Max\*\* to see whether the queue is usually fast with rare spikes or consistently slow. Only the average is additive, so the total in the center is shown for \*\*Avg\*\* only. If capacity wait dominates, raise \`max\_parallel\_checks\`. - \*\*Average Queue Time\*\*: the full time a pull request spent in the queue. - \*\*Average CI Runtime\*\*: how long your CI takes. An increase here slows the whole queue down. - \*\*Batches Saved\*\*: batches that merged without running their own speculative checks, because a later batch containing their changes had already passed. Each one is a CI run the queue avoided. This requires \[\`skip\_intermediate\_results\`\](/merge-queue/batches#skip-intermediate-results-anti-flake-protection) on the queue. ## Monitoring the Queue with the CLI You can check your merge queue status from the command line with the Mergify CLI. The \[\`queue\` CLI reference\](/cli/queue) lists every command and flag. \`\`\`bash mergify queue status \`\`\` This displays: - \*\*Pause status\*\*: whether the queue is paused, with reason and elapsed time - \*\*Batches\*\*: batches organized by scope with status indicators and their pull requests - \*\*Waiting PRs\*\*: queued pull requests with priority, queue time, and estimated merge time Each batch reports a \[batch status\](/configuration/data-types#batch-status) describing what it is doing, such as running its checks or waiting for a schedule. To filter results to a specific branch: \`\`\`bash mergify queue status --branch main \`\`\` Use \`--json\` for machine-readable output: \`\`\`bash mergify queue status --json \`\`\` ### Inspecting a Pull Request To see the detailed state of a specific pull request in the queue: \`\`\`bash mergify queue show \`\`\` This displays the PR's position, priority, queue rule, CI checks summary, and blocking conditions. See the \[\`mergify queue show\` reference\](/cli/queue#mergify-queue-show) for its flags. ## Integrations You can also build your own monitoring solution using the Mergify \[API\](/api/usage). --- # Unknown \--- title: Merge Strategies description: Choose how pull requests are merged into your base branch and control the shape of your git history. --- The \`merge\_method\` option in your queue rules controls how Mergify merges pull requests into your base branch. Each method produces a different git history shape, with trade-offs between linearity, SHA preservation, and throughput. ## Merge Methods at a Glance | Method | History | Commits on base branch | SHAs preserved | Queue parallelism | |---|---|---|---|---| | \`merge\` | Non-linear | Original commits + merge commit | Yes | Full | | \`squash\` | Linear | 1 new commit per PR | No | Full | | \`rebase\` | Linear | Recreated copies of each commit | No | Full | | \`fast-forward\` | Linear | Original commits moved to base | Yes | Serial only | | \`merge-batch\` | Non-linear | Original commits + 1 merge commit per PR + 1 per batch | Yes | Full | ## Merge \`\`\`yaml queue\_rules: - name: default merge\_method: merge \`\`\` Creates a merge commit joining the PR branch into the base branch. This is the default GitHub merge behavior. When you leave \`merge\_method\` unset, Mergify uses the first method your repository allows, so a repository that disallows merge commits falls back to squash or rebase instead. \- \*\*History:\*\* non-linear; the PR branch and base branch are visible as separate lines in \`git log --graph\` - \*\*Merge commits:\*\* yes; each PR produces a merge commit on the base branch - \*\*SHAs preserved:\*\* yes; original PR commits keep their SHAs - \*\*Use case:\*\* most teams; simplest setup with no constraints on parallelism or batching ## Squash \`\`\`yaml queue\_rules: - name: default merge\_method: squash \`\`\` Squashes all PR commits into a single commit on the base branch. \- \*\*History:\*\* linear; one commit per PR on the base branch - \*\*Merge commits:\*\* no - \*\*SHAs preserved:\*\* no; a new commit is created - \*\*Use case:\*\* teams that want a clean \`git log\` where one commit = one PR ## Rebase \`\`\`yaml queue\_rules: - name: default merge\_method: rebase \`\`\` Replays each PR commit on top of the base branch, creating new commits with new SHAs. \- \*\*History:\*\* linear; no merge commits, individual commits are preserved - \*\*Merge commits:\*\* no - \*\*SHAs preserved:\*\* no; commits are recreated with new SHAs, so the PR branch ref won't match the base branch - \*\*Use case:\*\* teams that want linear history with individual commits visible, but don't need SHA preservation ## Fast-Forward \`\`\`yaml queue\_rules: - name: default merge\_method: fast-forward \`\`\` Fast-forward merging advances the base branch ref directly to the tested commit(s) using the Git API instead of creating a merge via GitHub. The exact behavior depends on whether the queue operates in \[inplace or batch-PR mode\](/merge-queue/batches#in-place-checks-no-batch-prs). ### Inplace Mode The PR is rebased on top of the base branch, CI runs on the PR itself, and the base branch ref is fast-forwarded to the PR's head commit. In this mode, \`update\_method\` must be set to \`rebase\` (the default). If a rebase update occurs, the commit SHAs on the PR will change; what fast-forward preserves are the SHAs of the PR branch at merge time. :::caution Combining fast-forward inplace mode with an \`update\_bot\_account\` makes Mergify refuse pull requests coming from a fork when they are queued. \`update\_method: merge\` is not a way out here: a fast-forward queue lands by moving the base branch onto the pull request's head, and it exists to keep merge commits out of that history. See \[Combining Merge and Update Methods\](#combining-merge-and-update-methods) for what to do instead. ::: \- \*\*History:\*\* strictly linear; commits sit directly on the base branch - \*\*Merge commits:\*\* none - \*\*SHAs preserved:\*\* yes; the exact same commit SHAs from the PR appear on the base branch ### Batch-PR Mode Mergify creates a batch PR that combines the queued pull requests, runs CI on that batch, and then fast-forwards the base branch to the batch PR's head commit. Because the batch branch combines multiple PRs, the history \*\*may contain merge commits\*\* from folding each PR into the batch branch. - \*\*History:\*\* linear at the base-branch level, but individual merge commits from combining PRs may appear - \*\*Merge commits:\*\* possible (from combining PRs in the batch branch) - \*\*SHAs preserved:\*\* the final merged result is the exact SHA tested by CI ### Constraints - \*\*\`commit\_message\_format\` has no effect\*\*: fast-forward preserves the original commits, so custom commit messages are not applicable - \*\*\[Parallel and isolated modes\](/merge-queue/queue-modes) are not supported\*\*: both merge batches independently of each other, which fast-forward cannot do. Mergify rejects a queue rule that combines them - \*\*Use case:\*\* teams and OSS projects that care about commit identity and want the exact CI-tested code on their base branch :::caution Fast-forward requires Mergify to push directly to the base branch without going through a pull request merge. If GitHub branch protections are enabled, you must allow Mergify to \*\*bypass the required pull requests\*\* setting. See \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets) for setup instructions. ![Mergify bypass required pull requests](https://docs.mergify.com/merge-queue/%7BrequiredPRbypassScreenshot%7D) ::: ### Examples Inplace mode, with strictly linear history and preserved commit SHAs: \`\`\`yaml merge\_queue: max\_parallel\_checks: 1 queue\_rules: - name: default merge\_method: fast-forward batch\_size: 1 queue\_conditions: - check-success = ci \`\`\` The CI check sits in \`queue\_conditions\` rather than \`merge\_conditions\` on purpose: a queue with separate \`merge\_conditions\` is a \[two-step CI\](/merge-queue/two-step) queue, and Mergify runs its checks on a batch pull request instead of in place. See \[In-place checks (no batch PRs)\](/merge-queue/batches#in-place-checks-no-batch-prs) for the full list of conditions a queue has to meet to check in place. Batch-PR mode, combining batching with fast-forward merge: \`\`\`yaml queue\_rules: - name: default merge\_method: fast-forward batch\_size: 5 merge\_conditions: - check-success = ci \`\`\` ## Merge Batch \`\`\`yaml queue\_rules: - name: default merge\_method: merge-batch batch\_size: 5 merge\_conditions: - check-success = ci \`\`\` When \`merge\_method\` is set to \`merge-batch\`, Mergify merges the batch pull request it creates for batching directly into the base branch using a merge commit, instead of merging the original pull requests individually. This is similar to \`fast-forward\` in that the batch PR itself is merged, but uses the GitHub pull request merge API rather than advancing the git ref directly. The merge commit that lands on the base branch is titled after the pull requests included in the batch (for example, \`Merged #42, #43, #44\`), with \`Merged by Mergify Merge Queue\` as its body. The merges inside the batch branch carry a title of their own, \`Merge of #42\`, one per pull request. \- \*\*History:\*\* non-linear; a single merge commit per batch appears on the base branch - \*\*Merge commits:\*\* yes; one per batch on the base branch, plus one per PR inside the batch branch - \*\*SHAs preserved:\*\* yes; Mergify builds the batch branch by merging each embarked pull request's head into it, so that head commit becomes the second parent of a \`Merge of #42\` commit instead of a copy. Only the merge commits are new - \*\*Requires \`batch\_size > 1\`\*\*: this method is designed for batch merging and cannot be used with single PRs - \*\*Use case:\*\* teams that use batch merging and want a single merge commit per batch on the base branch, triggering only one deployment per batch :::note Unlike \`fast-forward\`, \`merge-batch\` uses the standard GitHub pull request merge API, so it works with branch protection settings that require pull request merges. No bypass configuration is needed. ::: ## Editing the Batch Branch :::caution \`allow\_queue\_branch\_edit\` is \*\*deprecated\*\* and will be removed in a future release. There is no replacement: move the work now done on a batch branch onto the pull requests themselves. Once the option is gone, an edited batch branch dequeues the pull requests embarked in it and reports the edit as a failure, which is what a queue that leaves the option unset already does. ::: By default, if anything other than Mergify pushes a commit to the branch of a \[batch PR\](/merge-queue/batches), Mergify dequeues the pull requests embarked in it and reports the failure. Setting \`allow\_queue\_branch\_edit: true\` on a queue rule tells Mergify to trust the branch instead and keep going. That option requires \`merge\_method: merge-batch\` or \`merge\_method: fast-forward\`. Those are the only two methods that merge the batch branch itself, so they are the only ones that can land a commit pushed to it. With \`merge\`, \`squash\` or \`rebase\`, each pull request is merged at its own head, the batch branch is never an input to the merge, and such a commit is dropped without a trace. Mergify rejects the configuration rather than letting the option look like it is doing something. Set \`merge\_method\` explicitly: leaving it unset is rejected as well, because the repository default it resolves to is never \`merge-batch\` or \`fast-forward\`. \`\`\`yaml queue\_rules: - name: default merge\_method: merge-batch batch\_size: 5 allow\_queue\_branch\_edit: true \`\`\` :::caution Under these two merge methods, what lands on the base branch is the batch branch as a whole. Enabling this option therefore means merging commits that were never reviewed as part of any pull request. That is what the option is for: batch-level work such as a conflict resolution or a lockfile regeneration that belongs to no single pull request. Make sure only Mergify and your own tooling can push to these branches. ::: If the work you push to a batch branch is resolving a conflict on a known set of files, \[\`conflict\_resolvers\`\](/merge-queue/lifecycle#resolving-some-conflicts-automatically) handles those files while Mergify builds the batch, with no push to the branch and under the same two merge methods. An accepted edit also restarts the batches behind the edited one, whenever \[parallel checks\](/merge-queue/performance#parallel-checks) put more than one batch in flight. Each of those batches was composed on top of what the batches ahead were expected to merge, so from the edit onwards their checks run against a tree that will never exist. Mergify tears them down, recomposes them on the edited head and starts their checks again; the pull requests stay in the queue throughout. The edited batch itself keeps going, since its own checks already run on the head that was pushed. Discarding the running checks behind it is the cost of editing a batch branch that has work queued after it. Mergify also does not mark the embarked pull requests as merged one by one here. GitHub considers a pull request merged only once its head commit is reachable from the new base branch tip, so a pull request whose head no longer matches what was embarked is not shown as merged even though its content landed. ## Combining Merge and Update Methods The \`update\_method\` option controls how Mergify updates PR branches when they fall behind the base branch. Combining \`merge\_method\` with \`update\_method\` gives you additional control over your history shape. :::caution Mergify refuses a pull request coming from a fork at queue entry if the queue \[runs its checks in place\](/merge-queue/batches#in-place-checks-no-batch-prs) with \`update\_method: rebase\` and an \`update\_bot\_account\`. GitHub refuses an OAuth token on its rebase API for a fork, so rebasing on behalf of a user would mean impersonating that user to force-push the contributor's branch, and Mergify does not do that. Unset \`update\_bot\_account\` to keep queueing pull requests from forks: with no account to impersonate, the update rebases through GitHub's API as Mergify. On a queue that does not merge with \`fast-forward\`, \`update\_method: merge\` works too, and merges the base branch into the pull request rather than rebasing it. Some pull requests from a fork go the other way: for one that changes GitHub Actions workflows, or that another GitHub App's bot opened, GitHub lets Mergify update in place only \*with\* an \`update\_bot\_account\`. The same goes for one that changes more files than GitHub lists, because Mergify cannot rule out a workflow change among the files it cannot see. A queue that receives any of these has to run its checks on a \[draft pull request\](/merge-queue/batches) instead. ::: ### Semi-Linear History (Rebase + Merge Commit) \`\`\`yaml queue\_rules: - name: default merge\_method: merge update\_method: rebase \`\`\` PRs are rebased on top of the base branch before being merged with a merge commit. This produces a history where individual commits are linear, but each PR is wrapped in a merge commit that marks the PR boundary. - \*\*Use case:\*\* teams that want linear commits but also want merge commits as PR boundary markers in \`git log --graph\` ### Linear History via Rebase Update \`\`\`yaml queue\_rules: - name: default merge\_method: rebase update\_method: rebase \`\`\` PRs are rebased to stay current, then rebased again at merge time. This produces a fully linear history with no merge commits, though SHAs will differ from the original PR branch. ## Choosing the Right Strategy | I want... | \`merge\` | \`squash\` | \`rebase\` | \`fast-forward\` | \`merge-batch\` | |---|:---:|:---:|:---:|:---:|:---:| | Linear history | | ✔ | ✔ | ✔ | | | Preserved commit SHAs | ✔ | | | ✔ | ✔ | | One commit per PR | | ✔ | | | | | One merge commit per batch on the base branch | | | | | ✔ | | Individual PR commits visible | ✔ | | ✔ | ✔ | ✔ | | See PR boundaries in \`git log\` | ✔ | | | | ✔ | | \[Batches\](/merge-queue/batches) and \[parallel checks\](/merge-queue/performance#parallel-checks) | ✔ | ✔ | ✔ | | ✔ | | Single deployment per batch | | | | ✔ | ✔ | --- # Unknown \--- title: "Merge queues use an automatic checks timeout by default" date: 2026-06-29 tags: - Merge Queue description: "Merge queues now default to an automatically computed checks timeout based on each queue's recent CI runtime." --- Previously, a merge queue had no checks timeout unless you configured one explicitly. The \`checks\_timeout\` option now defaults to \`auto\`, so Mergify computes a sensible timeout from your queue's recent CI runtime once enough history has been gathered. Nothing changes for queues that already set an explicit timeout, or that set \`null\` to disable the timeout entirely. --- # Unknown \--- title: Reviewing Stacks description: A reviewer's guide to navigating and reviewing stacked pull requests. --- Stacked PRs look and feel like regular pull requests, just smaller. You don't need to install anything or learn new tools to review them. ## What You'll See Each stacked PR contains a single commit's worth of changes. At the top of every PR, a stack comment shows the full chain and highlights the current PR: ![Stack comment showing the current PR in the chain](https://docs.mergify.com/stacks/%7BStackComment%7D) The comment includes links to every PR in the stack, so you can jump between them. ## How to Review ### Start from the Bottom Review the stack in order, starting with the first PR (the one targeting \`main\`). Each subsequent PR builds on the previous one, so reviewing in order gives you the narrative of the change. ### Each PR Shows Only Its Own Changes Unlike a single large PR, each stacked PR's diff contains only the changes from its corresponding commit, not the accumulated changes of the entire branch: - PR #1 shows the data model changes - PR #2 shows only the API endpoint, not the model + endpoint - PR #3 shows only the tests, not everything combined You review small, focused diffs instead of trying to parse hundreds of lines at once. ### Navigate Between PRs Use the links in the stack comment to move between PRs. The current PR is marked in the list so you always know where you are in the chain. ## Leaving Feedback Review comments work exactly like any other PR: - Leave inline comments on specific lines - Request changes or approve - Use GitHub's review features normally When the author addresses your feedback, they'll rebase and push. The PR updates in place, and your review comments stay attached to the relevant lines. ## Revision History Each push keeps a revision-history comment on the PR, so you can see how the commit evolved between reviews instead of guessing what changed since you last looked. The timeline marks every revision, from the initial push through later rebases and content edits, and links to the underlying commit SHAs: ![Mergify Stacks panel with the stack and its revision history timeline on a PR](https://docs.mergify.com/stacks/%7BRevisionHistory%7D) When the author amends a commit, they can attach a short note explaining why. That reason shows up against the matching revision, so you don't have to diff old and new SHAs to understand what moved. :::tip The \[Mergify browser extension\](/browser-extensions) renders the stack and its revision history directly in the GitHub pull request, as shown above. ::: ## Merging Stacked PRs Stacked PRs merge bottom-up. The first PR in the stack (targeting \`main\`) merges first, and the next one is retargeted onto \`main\`. GitHub does that itself for a stack registered with its stacking API. For a stack pushed with \[\`--no-github-native\`\](/stacks/setup#configuration), it happens when the merged head branch is deleted, which is why \[Setup\](/stacks/setup) asks you to turn automatic head-branch deletion on. The author brings the rest of the stack in line by running \[\`mergify stack sync\`\](/stacks/updating#after-a-pr-merges) and pushing again. You review and merge each PR in turn, working up the chain. :::tip Comment \`@mergifyio queue\` on the top PR and the Merge Queue enqueues the whole stack at once, bottom-up. See \[Stacked PRs in the Merge Queue\](/merge-queue/stacks) for the full mechanics. ::: You don't need to merge the entire stack at once. If the first two PRs are approved but the third needs more work, merge the first two and let the author continue iterating on the rest. --- # Unknown \--- title: TestNG Integration with Mergify description: Report your test results from TestNG tests to Mergify --- This guide shows how to generate JUnit reports from your TestNG tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with TestNG TestNG can generate JUnit-compatible XML reports. You need to configure your build tool to enable JUnit report generation alongside the default TestNG reports. ### Using Maven Configure the Surefire plugin in your \`pom.xml\` to generate JUnit reports: \`\`\`xml org.apache.maven.plugins maven-surefire-plugin 3.5.3 usedefaultlisteners false listener org.testng.reporters.JUnitReportReporter ${project.build.directory}/surefire-reports \`\`\` Run tests with: \`\`\`bash mvn test \`\`\` ### Using Gradle Gradle's \`test\` task writes JUnit XML reports without any extra configuration. Point the task at TestNG in your \`build.gradle\`: \`\`\`groovy test { useTestNG() } \`\`\` Run tests with: \`\`\`bash ./gradlew test \`\`\` The JUnit XML reports will be generated in \`build/test-results/test/\`. ### Using TestNG Directly You can also run TestNG directly with JUnit listener: \`\`\`bash java -cp "your-classpath" org.testng.TestNG -listener org.testng.reporters.JUnitReportReporter testng.xml \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run TestNG Tests and Generate JUnit Report id: tests continue-on-error: true run: mvn test \`\`\` For Gradle projects: \`\`\`yaml - name: Run TestNG Tests and Generate JUnit Report id: tests continue-on-error: true run: ./gradlew test \`\`\` \### Buildkite For Maven projects: For Gradle projects: \### Any CI (Mergify CLI) For Maven projects: For Gradle projects: \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your TestNG tests. 2. JUnit-compatible XML reports are generated. 3. The Mergify CI action uploads the reports to Test Insights. \## Troubleshooting Tips * JUnit Listener: Ensure the JUnitReportReporter listener is properly configured in your TestNG setup. --- # Unknown \--- title: Prevention description: Catch flaky and broken tests on pull requests before they reach your codebase. --- Prevention monitors tests introduced or modified in pull requests. By rerunning tests on PRs, it detects flaky behavior before code merges, keeping your codebase reliable. ![Prevention dashboard: caught-flaky metrics and new-tests list](https://docs.mergify.com/test-insights/%7BPreventionScreenshot%7D) ## How it works When a pull request runs tests, Mergify reruns them to check for consistency. Tests that produce different results on the same commit are flagged as flaky. This happens transparently as part of your existing CI pipeline, with no changes to your test code needed. Tests caught as flaky on a PR are prevented from silently degrading your test suite. You can review their health status before deciding to merge. ## What you can track Prevention provides key metrics to help you understand test reliability on pull requests: ### Caught flaky tests The number of flaky tests detected during PR reruns. This is the core value of Prevention: every caught test is a reliability problem that didn't make it into your codebase. ### New tests Tests being introduced on PRs, along with their health status. Each new test is classified as healthy, flaky, or broken based on its rerun results. This helps you spot unreliable tests before they're merged. ### CI budget spent The total CI time spent on reruns. This metric helps teams understand the cost of flaky test prevention and make informed trade-offs between thoroughness and CI budget. ## Practical workflows ### Reviewing tests before merging When a PR introduces or modifies tests, check the Prevention page to see their health status. Tests with a flaky or broken status should be investigated before merging. ### Filtering by pull request state Use the pull request state filter to focus on specific PRs: - \*\*Open\*\*: Tests on PRs still in review - \*\*Merged\*\*: Tests on PRs that have already been merged - \*\*Closed\*\*: Tests on PRs that were closed without merging ### Understanding confidence on new tests New tests have limited run data, so their confidence level may be low. A low confidence means the health status could change as more data is collected. Consider waiting for more runs before drawing conclusions about a test's reliability. ## Setup Prevention requires a test framework plugin that instruments test runs, and it is opt-in per repository. Once a plugin is installed, set a rerun budget on the \[Prevention page\](https://dashboard.mergify.com/test-insights/prevention) in the dashboard to enable it. Until then, Mergify collects test results but does not rerun tests. See the \[test framework configuration\](/test-insights#test-framework-configuration) for setup instructions specific to your framework (pytest-mergify, rspec-mergify, etc.). --- # Unknown \--- title: Setup description: Install Mergify CLI and configure your repository for stacked PRs. --- ## 1. Install the Mergify CLI See the \[CLI installation guide\](/cli/usage) for full instructions. Quick install: \## 2. Install skills for your AI coding agent Mergify ships \[Agent Skills\](/cli/agents) that teach AI coding agents how to work with Stacks, so they run \`mergify stack push\` instead of \`git push\`, amend commits instead of creating fixups, and follow stack conventions automatically. \*\*Claude Code:\*\* \`\`\`text /plugin install mergify@claude-plugins-official \`\`\` \*\*Codex, Cursor, and any other \[skills.sh\](https://skills.sh) agent:\*\* \`\`\`bash npx skills add Mergifyio/mergify-cli \`\`\` Either command installs the whole bundle, which also covers the merge queue, CI Insights, config validation, and scheduled freezes. See \[Agent Skills\](/cli/agents) for what each skill does and which token it needs. :::tip Prefer to hand a single URL to your agent? Point it at \[docs.mergify.com/stacks/agents\](/stacks/agents). That page walks the agent through installing the CLI and the Stacks skill itself. ::: ## 3. Configure GitHub Stacks creates and updates pull requests through the GitHub API, so it needs a GitHub token. Neither a Mergify \[application key\](/api/usage) nor \`mergify auth login\` helps here: those authenticate to the Mergify API, which Stacks never calls. The simplest option is the \[GitHub CLI\](https://cli.github.com/). Install it, run \`gh auth login\`, and Stacks picks up its token on its own. To manage the token yourself instead, export it as \`GITHUB\_TOKEN\`. See \[GitHub token for Stacks\](/cli/usage#github-token-for-stacks) for the order Stacks tries them in. :::caution Stacks reads \`MERGIFY\_TOKEN\` before either of those. If you have set it to a Mergify application key, as the CI Insights and Merge Queue Scopes pages tell you to, Stacks picks that key up and GitHub rejects it. Pass \`--token\` to your Stacks commands, or keep the application key out of \`MERGIFY\_TOKEN\`. ::: Enable "\[Automatically delete head branches\](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches)" in your GitHub repository settings (Settings > General > Pull Requests). When a stacked PR merges, this cleans up its remote branch automatically. For a stack pushed with \[\`--no-github-native\`\](#configuration), that deletion is also what makes GitHub retarget the next PR in the chain onto \`main\`. GitHub does that itself for a stack registered with its stacking API. See \[Merging Stacked PRs\](/stacks/reviewing#merging-stacked-prs). ![GitHub setting: Automatically delete head branches](https://docs.mergify.com/stacks/%7BdeleteHeadBranches%7D) ## 4. Initialize your repository Run the setup command in your Git repository: \`\`\`bash mergify stack setup \`\`\` This installs: - A \`commit-msg\` Git hook that automatically generates a \[Change-Id\](/stacks/concepts#change-id) for every new commit. The Change-Id is how Stacks tracks the relationship between your local commits and their GitHub pull requests. - A \`prepare-commit-msg\` hook that keeps the Change-Id when you amend with \`git commit --amend -m\` or \`-F\`. A new message passed that way would otherwise replace the old one, trailer included. - A \`post-commit\` hook that adds a Change-Id to a commit that still has none, in case the \`commit-msg\` hook did not run. - A \`pre-push\` hook that stops you if you accidentally use \`git push\` instead of \`mergify stack push\` on a stack branch. Run \`git push --no-verify\` to push anyway. The command also sets two local Git config values, \`notes.displayRef\` and \`notes.rewriteRef\`, so \`git log\` shows the \[notes\](/stacks/updating#record-why-you-amended) you attach with \`mergify stack note\`, and a note stays with its commit when you amend or rebase it. ## Verify It Works \`mergify stack hooks\` reports whether the hooks are installed and up to date. To watch one work, create a test commit: \`\`\`bash echo "test" >> test.txt git add test.txt git commit -m "test: verify stack setup" \`\`\` Check the commit message: \`\`\`bash git log -1 \`\`\` You should see a \`Change-Id\` trailer at the bottom of the message: \`\`\`text test: verify stack setup Change-Id: Ia1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2 \`\`\` :::tip If you already have commits without Change-Ids, run \`git rebase -i \` and choose \*\*reword\*\* for each commit. The hook will add the Change-Id automatically when you save the message. ::: Clean up the test commit if you don't need it: \`\`\`bash git reset HEAD~1 \`\`\` ## Configuration These optional Git config settings let you customize Stacks behavior: | Setting | Default | Description | |---------|---------|-------------| | \`mergify-cli.stack-branch-prefix\` | \`stack/{username}\` | Set the prefix for remote branch names | | \`mergify-cli.stack-create-as-draft\` | \`false\` | Create PRs as drafts by default | | \`mergify-cli.stack-github-native\` | \`true\` | Register the stack with GitHub's stacking API | | \`mergify-cli.stack-keep-pr-title-body\` | \`false\` | Don't overwrite PR title/body on updates | | \`mergify-cli.stack-revision-history\` | \`true\` | Keep a revision-history comment on each PR | Example: \`\`\`bash git config mergify-cli.stack-create-as-draft true \`\`\` \`mergify stack push\` has a flag for each of these (\`--branch-prefix\`, \`--draft\`, \`--no-github-native\`, \`--keep-pull-request-title-and-body\` and \`--no-revision-history\`) to override the setting for a single push. \`--branch-prefix\` is also accepted by \`mergify stack list\`, \`mergify stack open\` and \`mergify stack sync\`, which have to look for the same branches. Setting the Git config once covers all four. The \[\`stack\` CLI reference\](/cli/stack) lists every command in the group with its full set of flags and defaults. :::note \`mergify-cli.stack-github-native\` defaults to \`true\`. On top of the usual push, it registers the stack with GitHub's own stacking API, so GitHub shows the pull requests as a stack of its own and holds their order. A registered stack carries no \`Depends-On:\` marker in its pull request descriptions; the \[Merge Queue\](/merge-queue/stacks#github-native-stacked-pull-requests) recognizes it and lands its members bottom-up, the same way it lands a \`Depends-On:\` chain. Where that API isn't available, the push reports \`not registered on GitHub\`, writes the \`Depends-On:\` markers back, and otherwise goes through as usual. Pass \`--no-github-native\`, or set the Git config to \`false\`, to push a \`Depends-On:\` chain without trying to register. ::: ## Next Steps Head to \[Creating Stacks\](/stacks/creating) to push your first stack. --- # Unknown \--- title: Actions description: A complete list of actions you can use with Mergify. --- Actions are the engine that powers Mergify. They define what Mergify should do when a set of conditions is met. This can range from merging a pull request, updating it with the latest changes, commenting on the pull request, assigning it to a user, adding labels, and more. Actions are the tasks that Mergify performs on your behalf. By combining actions, you can automate most of the routine tasks associated with pull request management. Assign a pull request to a user. Copy a pull request to another branch once it is merged. Close a pull request. Copy a pull request to another branch. Post a comment on a pull request. Deprecated. Use GitHub's built-in "Automatically delete head branches" setting instead. Dismiss previous reviews on a pull request. Convert a pull request to or from a draft. Deprecated. Start your workflows from GitHub Actions events instead. Add, remove, or toggle labels on a pull request. Automate the merging of your pull requests. Deprecated. Use Merge Protections instead. Add the pull request to the merge queue. Rebase the pull request on top of its base branch. Request reviews from specific users or teams. Automate reviews for your pull requests with customizable comments and review types. Update the pull request branch with its base branch. Squash commits in the pull request. --- # Unknown \--- title: "Scope \`check-\*\` conditions to a specific GitHub App" date: 2026-06-02 tags: - Rules description: "Bind a \`check-\*\` condition to the GitHub App that posted the check, so collisions from other installations cannot satisfy the rule." --- Write \`check-success=@github-actions/ci/lint\` to require that the \`ci/lint\` check was posted by the \`github-actions\` app — useful when a third-party app could publish a check with the same name. The bare form (\`check-success=ci/lint\`) keeps matching any app, so existing rules are unaffected. --- # Unknown \--- title: "New activity log page" date: 2026-06-02 tags: - Merge Queue description: "The Activity Log, a faster, filterable view of every Mergify event. Now replaces Event Logs on all repositories." --- The Activity Log is now available on every repository, replacing Event Logs, a faster, filterable timeline of every Mergify event (merge queue, CI Insights, workflow automation) with shareable links to any filtered view. ![Changelog Image](https://docs.mergify.com/changelog/%7Bstatic372f2b37c5da807b8275d84a088e52cfpng%7D) --- # Unknown \--- title: "Address cancelled checks separately with check-cancelled" date: 2026-06-09 tags: - Rules description: "A new check-cancelled condition attribute matches checks with a cancelled conclusion independently from check-failure." --- Mergify now provides a \`check-cancelled\` condition attribute that matches checks reporting a \`cancelled\` conclusion — for example GitHub Actions jobs stopped by \`concurrency: cancel-in-progress\`. Cancelled checks are still matched by \`check-failure\` for backward compatibility, but you can now exclude them from failure-based rules by combining \`check-failure=\` with \`-check-cancelled=\`, so a cancellation no longer triggers actions meant for genuine failures. --- # Unknown \--- title: "Set your merge queue checks timeout automatically" date: 2026-06-11 tags: - Merge Queue description: "Merge queues can now compute their checks timeout from recent CI runtimes with \`checks\_timeout: auto\`, instead of requiring a fixed value." --- Set \`checks\_timeout: auto\` on a queue and Mergify derives the timeout from that queue's own recent CI runtimes (its 95th-percentile run time, plus a safety margin) — so you don't have to guess a value, and a hung CI no longer sits in the queue indefinitely. The merge queue's batch side-peek now shows when a batch's checks will time out, and the checks-timeout dequeue message states the exact budget that was exceeded (e.g. "the checks did not pass within the checks timeout of 45 minutes"). This will be enabled by default on 2026-06-22. --- # Unknown \--- title: "Queue or requeue a pull request with a checkbox" date: 2026-06-19 tags: - Merge Queue description: "Queue or requeue a pull request by ticking a checkbox in the Mergify status comment, without typing a command." --- Mergify now posts a Merge Queue status comment with a GitHub task-list checkbox. Tick \*\*Queue this pull request\*\* to add a pull request to the merge queue, or \*\*Requeue this pull request\*\* after a failed attempt — no need to type \`@mergifyio queue\`. Clicking a checkbox runs the same action as the command, with the same write-permission and command-restriction checks, so nothing is queued by someone who couldn't queue it manually. Turn it off with \`queue\_controls\_comment\` in your merge queue configuration. --- # Unknown \--- title: "Merge protections honor GitHub's \\"require approval of most recent push\\"" date: 2026-06-19 tags: - Merge Protections description: "Mergify now respects GitHub's \\"Require approval of the most recent push\\" branch-protection option when evaluating merge protections." --- When your branch protection enables GitHub's "Require approval of the most recent push" option, Mergify now automatically adds a matching condition to your merge protections. A pull request won't merge until its latest push has been approved by someone other than the author, keeping Mergify aligned with GitHub's own enforcement. --- # Unknown \--- title: "Limit concurrent checks per scope" date: 2026-06-03 tags: - Merge Queue description: "Cap how many speculative checks run in parallel for each merge queue scope, so heavy areas of your monorepo can't starve the rest." --- The new \`scopes.capacities\` map declares a per-scope checks budget on top of \`merge\_queue.max\_parallel\_checks\`. A pull request is checked only when the global ceiling and every scope it touches have room, so noisy or slow scopes don't crowd out the rest of the train. The same syntax works whether scopes come from file globs (\`source: files\`) or the manual scopes API (\`source: manual\`), and scopes you don't list stay unlimited (only the global ceiling applies). --- # Unknown \--- title: "Reference the pull request author in conditions with {{ author }}" date: 2026-06-19 tags: - Rules description: "Rule conditions now accept {{ author }} as a built-in value for matching an attribute against the pull request author." --- You can now use \`{{ author }}\` in rule conditions — for example \`sender = {{ author }}\` or \`commits\[\*\].author = {{ author }}\` — to match an attribute against the pull request's author. It's resolved as a native, built-in value, accepted everywhere, and existing configurations keep working unchanged. --- # Unknown \--- title: "CI & Test Insights stats now available in the public API" date: 2026-07-08 tags: - CI Insights - Test Insights description: "The test, runner, and CI queue stats endpoints are now part of Mergify's public REST API, each returning a window summary value plus a per-day time series." --- You can now query your Test Insights and CI Insights statistics — test health, runner activity, and CI queue metrics — directly from Mergify's public REST API. Every stats endpoint returns both a summary value for the window you select and a per-day series, so you can build your own reports, dashboards, and CI automation on the same data that powers the Insights dashboards. --- # Unknown \--- title: "Self-hosted Runners: Fleet & queue metrics" date: 2026-06-19 tags: - CI Insights description: "A capacity view of your self-hosted runner fleet — utilization, saturation, active vs. available runners, and queue-wait time broken down by the labels jobs request." --- The Self-hosted Runners page now answers "is my fleet correctly sized?" at a glance. A capacity view shows fleet utilization with a 100% saturation line, plus active runners against your fleet ceiling. A new Queue tab charts how long jobs wait to acquire a runner over time, grouped by the label-set they request — filter by labels and read the per-label-set breakdown to spot which runner pools are starved and size your fleet accordingly. Configuration moved to its own page so the metrics stay front and centre. --- # Unknown \--- title: "Dequeue a pull request from the merge queue" date: 2026-07-08 tags: - Merge Queue description: "Manually remove a queued pull request from the merge queue from the dashboard, with a confirmation dialog showing the impact." --- You can now dequeue a pull request from the merge queue directly from its side panel in the dashboard. Before removing it, a confirmation dialog shows how many in-progress batches will be interrupted and how many other pull requests will be rechecked, so you understand the impact before acting. --- # Unknown \--- title: "Safe templating for GitHub Actions workflow inputs" date: 2026-06-29 tags: - Workflow Automation description: "Workflow-dispatch inputs in the github\_actions action now use safe {{ variable }} templating, with raw Jinja2 deprecated." --- The inputs you pass to a dispatched GitHub Actions workflow now support Mergify's simple, safe \`{{ variable }}\` interpolation — the same allowlisted templating rolling out across comment, review, and copy/backport message fields. Your existing \`{{ }}\` inputs keep working unchanged; raw Jinja2 templating in these inputs is now deprecated and will be removed in a future release. --- # Unknown \--- title: "Direct Merge for scope-unaffected pull requests" date: 2026-07-20 tags: - Merge Queue description: "A queued pull request that is behind the base branch only by merges touching other scopes is now merged immediately, with no draft pull request and no merge queue CI run." --- When a pull request reaches the front of its lane on its own, Mergify now looks at which scopes the merge queue has landed on the base branch since that pull request last updated. If none of them overlap the pull request's own scopes, nothing it depends on has changed, so its existing green CI already covers the merge and Mergify merges it directly: no draft pull request, no second CI run, seconds instead of a full test cycle. This works in parallel mode as well as serial, and it needs scopes to be set. Mergify declines it and falls back to the usual draft whenever it cannot prove the base changes are unrelated, including a pull request with no scopes or an \`all\_scopes\` barrier, an external merge or a direct push to the base branch, two-step CI, autosquash, and fast-forward or merge-batch queues. There is nothing to configure. Any repository already using scopes gets Direct Merge on the pull requests that qualify. --- # Unknown \--- title: "New \\"Batches Saved\\" merge queue statistic" date: 2026-07-24 tags: - Merge Queue description: "The merge queue Statistics page now shows how many CI runs skip\_intermediate\_results saved — the number of batches merged without running their own speculative CI." --- The Merge Queue \*\*Statistics\*\* page now includes a \*\*Batches Saved\*\* chart in the Performance section. It counts the batches that merged without running their own speculative CI — because a later batch containing their changes had already passed — so you can see how many CI runs \`skip\_intermediate\_results\` is saving your team. --- # Unknown \--- title: "See what a queued pull request is waiting on" date: 2026-07-24 tags: - Merge Queue description: "The merge queue now shows which queued pull requests a pull request depends on, so its position in the queue is explained." --- A pull request that declares a \`Depends-On:\` merges after the ones it depends on, so it can sit behind a lower-priority pull request in the queue with no visible reason. Queued pull requests held back by a dependency now carry a dependency icon in the merge queue list, and the pull request side panel gains a "Depends On" section listing each queued pull request it is waiting on, with a link to each one. The same information is available from the merge queue status API as \`depends\_on\_pull\_requests\`. --- # Unknown \--- title: "Avg, P95, and Max in the Merge Queue Time Breakdown" date: 2026-07-24 tags: - Merge Queue description: "The Merge Queue Stats page's Time Breakdown now lets you switch each queued-time component between average, 95th percentile, and max." --- The Time Breakdown widget on the Merge Queue Stats page has a new Avg / P95 / Max selector. Alongside the typical split of a pull request's time in queue — CI runtime, waiting for CI capacity, schedule windows, and freeze periods — you can now see the 95th percentile and the maximum of each. Slow outliers that an average smooths over become visible, so you can tell whether a queue is usually fast with rare spikes or consistently slow. --- # Unknown \--- title: "Label pull requests while the merge queue checks them" date: 2026-07-29 tags: - Merge Queue description: "A new \`checking\_label\` option labels a pull request for the whole time the merge queue is checking it." --- Set \`checking\_label\` under \`merge\_queue\` to label a pull request while the merge queue is actually checking it. Where \`queued\_label\` marks every pull request sitting in the queue, \`checking\_label\` narrows that down to the ones the queue is working on right now: it goes on from the moment a pull request enters a batch and comes off when it leaves the queue, and it stays on while a pull request waits in a bisection, before its own CI has started. No label is added unless you set the option. --- # Unknown \--- title: "The github\_actions action is deprecated" date: 2026-07-29 tags: - Workflow Automation - Deprecations description: "The github\_actions workflow automation action is deprecated and will be removed on 31 March 2027. Trigger your workflows from GitHub Actions directly with on: pull\_request, workflow\_dispatch, or repository\_dispatch instead." --- The \`github\_actions\` action in \`pull\_request\_rules\` is deprecated. It keeps working until \*\*31 March 2027\*\*, after which it is removed. If you use it, you will now see a deprecation notice in the Mergify check run on your pull requests, and a \*Deprecated\* badge on the action in the dashboard editor. Nothing else changes: your workflows are still dispatched exactly as before. ## Why Everything this action does can be done by GitHub Actions itself, without Mergify in the middle. Triggering your workflow natively means one fewer moving part between a pull request event and the workflow that reacts to it. ## What to use instead Most rules using this action react to something that already has a native GitHub trigger. A rule that runs a workflow after a merge: \`\`\`yaml pull\_request\_rules: - name: trigger JIRA transition conditions: - merged actions: github\_actions: workflow: dispatch: - workflow: jira-transition.yaml \`\`\` becomes a trigger on the workflow itself: \`\`\`yaml # .github/workflows/jira-transition.yaml on: pull\_request: types: \[closed\] jobs: transition: if: github.event.pull\_request.merged runs-on: ubuntu-latest steps: # ... \`\`\` When the workflow has to be triggered explicitly rather than by a pull request event, use \`workflow\_dispatch\` or \`repository\_dispatch\`. One thing does not carry across automatically: Mergify conditions. If your rule used conditions to decide whether the workflow should run, express that logic inside the workflow — as an \`if:\` on the job, or as a filter on the trigger. \[Documentation\](https://docs.mergify.com/workflow/actions/github\_actions) --- # Unknown \--- title: "Author-run commands now require a fork pull request" date: 2026-08-11 tags: - Rules description: "The default restrictions for update, rebase, squash and refresh now let the pull request author run them only on pull requests coming from a fork." --- By default, \`update\`, \`rebase\`, \`squash\` and \`refresh\` can be run by anyone with write access, or by the pull request author. The author part now only applies to pull requests coming from a fork. GitHub lets a user with read-only access open a pull request between two branches of a repository they cannot write to. The old default let that user have Mergify rewrite the head branch for them. On a fork the head branch is outside your repository, so the author case that this rule exists for is unchanged. If you set \`commands\_restrictions\` for these commands yourself, nothing changes. --- # Unknown \--- title: "New from-fork condition attribute" date: 2026-08-11 tags: - Rules description: "Conditions can now match on whether a pull request comes from a fork." --- \`from-fork\` is true when a pull request's head branch and base branch live in different repositories. Use it anywhere conditions are accepted, for example to skip a rule on external contributions: \`\`\`yaml - -from-fork \`\`\` It is also true when the head repository has been deleted. --- # Unknown \--- title: "Pin a deployment condition to the app that deployed" date: 2026-09-04 tags: - Rules description: "\`deployment-success\` and \`deployment-failure\` now accept the qualified \`@/\` form, so a rule can require an environment be deployed by one specific app." --- Anyone with the \`deployments: write\` permission on a repository can post a deployment status for any environment name, and two apps can deploy the same environment. Until now \`deployment-success = staging\` matched whichever one reported most recently, whoever that was. Both \`deployment-success\` and \`deployment-failure\` now take the same \`@/\` form the \`check-\*\` attributes already accept, so you can pin a condition to the deployer: \`deployment-success = @netlify/staging\` matches the staging deployment Netlify published and nothing else. The bare form keeps matching a deployment from any source, so existing configurations do not change. Mergify's own merge protections gate uses the qualified form too when the reporting method is \`deployments\`, so it can no longer be satisfied by a deployment status someone else posted. --- # Unknown \--- title: "Per-lane check capacity for dynamic scopes" date: 2026-08-25 tags: - Merge Queue description: "Set a single speculative-check budget that applies to every scope, so dynamic scope sets get per-lane capacity without listing scope names." --- The merge queue's \`scopes.capacities\` option needs every scope spelled out by name, which does not work when your scopes come from a build tool and change with every pull request. The new \`scopes.default\_capacity\` sets one budget that applies to any scope without an explicit \`capacities\` entry, so each lane runs its own speculative checks independently even when the scope set is dynamic. \`merge\_queue.max\_parallel\_checks\` stays the global ceiling on how many speculative checks run in total, and an explicit \`capacities\` entry still wins for its own scope. --- # Unknown \--- title: "Clearer reason when the merge queue can't create the draft pull request" date: 2026-08-25 tags: - Merge Queue description: "The dequeue reason now carries GitHub's own refusal message, including the repository rule that blocked the push." --- When GitHub refuses the draft pull request the merge queue builds for a batch, the dequeue reason no longer stops at "The draft pull request cannot be created". It now quotes what GitHub said — including the repository rule that blocked the push and the link to its settings page. One case gets an explicit remedy: a ruleset requiring verified signatures. Mergify composes batch commits itself and has no signing key, so the fix is to add the Mergify app as a bypass actor on that rule. --- # Unknown \--- title: "\`allow\_queue\_branch\_edit\` is deprecated" date: 2026-09-23 tags: - Merge Queue description: "The \`allow\_queue\_branch\_edit\` queue rule option is deprecated and will be removed after December 31, 2026." --- The \`allow\_queue\_branch\_edit\` queue rule option, which lets a merge queue trust commits pushed to a batch branch by something other than Mergify, is deprecated with no replacement and will be removed after December 31, 2026. If your configuration sets this option, move any work you're doing on the batch branch onto the pull requests themselves before then. Once the option is removed, an edited batch branch will dequeue the pull requests it carries and report the edit as a failure — the same thing that already happens today if you leave the option unset. --- # Unknown \--- title: "Jinja2 templating stops working on October 31, 2026" date: 2026-09-23 tags: - Deprecations - Rules description: "Jinja2 expressions in your Mergify configuration stop working on October 31, 2026; plain {{ variable }} placeholders keep working." --- Jinja2 templating in your Mergify configuration stops working on \*\*October 31, 2026\*\*. Filters, loops, \`{% if %}\` blocks and other expressions will no longer be evaluated in comment, review and close messages, in copy and backport titles, bodies and assignees, in bot accounts, or in GitHub Actions workflow inputs. Plain \`{{ variable }}\` placeholders drawn from each field's allowed variables keep working, as does a bare \`{{ author }}\` in a rule condition. Templating goes away in two more places on that date: label names, and rule conditions — where a value such as \`commits\[\*\].commit\_message~=^Merge branch '{{ base }}'\` is rendered for each pull request today. The Summary check of your pull requests now names every place your configuration still relies on it, with the date. Two settings deprecated earlier, \`commit\_message\_template\` and the \`post\_check\` action, keep their own announced removal date of September 30, 2026. --- # Unknown \--- title: "Pick a condition's scope from the repository's scopes" date: 2026-09-23 tags: - Merge Queue - Merge Protections description: "In the dashboard's condition editor, a condition on scope now offers the scopes declared in the repository's configuration instead of a free text field; a scope that is not declared stays editable and is discreetly marked." --- When you write a condition on \`scope\` in the dashboard — in a queue rule, a merge protection, a priority or a command restriction — the value is now picked from the scopes declared in your repository's configuration (\`scopes.source.files\`, or the \`capacities\` keys for a manual source) instead of being typed by hand. On the Queue Configuration page, scopes you have declared but not yet committed are offered too. A scope that is not in the list is kept and stays editable; when the repository's scopes come from files — so no pull request can ever carry an undeclared name — it is discreetly marked so a typo or a retired scope is easy to spot. Other operators (\`~=\`, \`\*=\`) keep the free text field, and the YAML editor's completion offers the same names. Pull request: \[https://github.com/Mergifyio/monorepo/pull/40964\](https://github.com/Mergifyio/monorepo/pull/40964) --- # Unknown \--- title: "Datadog integration: four merge queue metrics are being retired" date: 2026-09-08 tags: - Deprecations - Integrations description: "The operational Datadog metrics are retired in favour of the mergify.queue.\* set shipped in July. Two have a renamed counterpart, two have none." --- The Datadog integration published two sets of metrics side by side. The older set is now retired in favour of the \`mergify.queue.\*\` metrics shipped in July, which cover queue throughput, health and performance, and come with a ready-made dashboard. ## What stops being published - \`mergify.merge\_queue\_length\` - \`mergify.queue\_checks\_outcome\` - \`mergify.time\_to\_merge\`, along with its \`.mean\`, \`.median\`, \`.95percentile\`, \`.99percentile\`, \`.min\` and \`.max\` variants - \`mergify.scheduled\_freeze\` ## What to use instead Two of them have a close counterpart under a new name: Both carry a different Datadog metric type, so a dashboard widget needs adjusting rather than a simple rename. The time-to-merge percentiles and \`mergify.scheduled\_freeze\` have no direct replacement. ## What to check on your side If you built dashboards or monitors on any of these names, they will report no data once this ships. --- # Unknown \--- title: "Know when a queued pull request merged without landing anything" date: 2026-09-29 tags: - Merge Queue description: "The merge queue now flags a pull request that merged without changing the base branch, instead of leaving it looking like it shipped." --- When an equivalent change lands ahead of a queued pull request, rebasing drops all of its commits and the merge leaves the base branch untouched — while GitHub still marks the pull request merged and still shows its full diff. The Merge Queue Status comment now says so. A "Nothing landed" section explains both why the base branch is unchanged and why the Files changed tab still shows the whole diff, so the author no longer goes hunting for a commit that reached no branch. --- # Unknown \--- title: "Filter quarantined tests by health on Mitigation" date: 2026-09-29 tags: - Test Insights description: "Test Insights › Mitigation: filter the quarantined tests by health — find the ones that have recovered and release them from quarantine in one action." --- The Mitigation page lists the tests currently in quarantine, and could only be narrowed by test name — so a team wanting to release the tests that have since recovered had to read the Health column row by row. A Health filter now narrows the list to the tests whose health is healthy, flaky or broken. The filtering happens on the server, so the count follows the filter and pagination walks the filtered set; a quarantined test that has stopped running entirely counts as healthy, since that is exactly the debt a team is trying to clear. Combined with the bulk action on the same page, releasing every recovered test is: filter on healthy, select all, remove. Pull request: \[https://github.com/Mergifyio/monorepo/pull/41350\](https://github.com/Mergifyio/monorepo/pull/41350) --- # Unknown \--- title: "Pull requests from a fork can no longer be rebased" date: 2026-09-29 tags: - Workflow Automation - Deprecations description: "The rebase action and the @mergifyio rebase command now fail on a pull request that comes from a fork. Use update instead." --- Rebasing a pull request that comes from a fork required Mergify to impersonate a GitHub user and force-push the fork's branch, because GitHub refuses an OAuth token on its rebase API for a fork. That capability was deprecated for removal on July 1, 2026, and it has now been removed. A \`rebase\` action or an \`@mergifyio rebase\` command on a pull request from a fork now fails with a check run that explains why. Use the \`update\` action or the \`@mergifyio update\` command on those instead: it brings the pull request up to date by merging the base branch into it, and needs no impersonation. If the branch has to keep a linear history, its author has to rebase it themselves. This applies whether or not \`bot\_account\` is set: the rebase impersonated a user either way, falling back to the pull request author or to whoever sent the command. --- # Unknown \--- title: "Repository badge API removed" date: 2026-08-25 tags: - API description: "The deprecated /v1/badges/\* endpoints are gone; a Mergify badge embedded in a README no longer renders." --- The \`/v1/badges/\*\` endpoints, which served a \[shields.io\](http://shields.io/) badge showing whether Mergify was enabled on a repository, have been removed. They were deprecated in March 2026 and now return 404. If you embed a Mergify badge in a README (\`https://api.mergify.com/v1/badges//.svg\`), remove the image. There is no replacement endpoint. --- # Unknown \--- title: "Remove several tests from quarantine at once, from the Mitigation page" date: 2026-09-29 tags: - Test Insights description: "Test Insights › Mitigation: select several quarantined tests and remove them from quarantine in one action, directly from the list of quarantined tests." --- The Mitigation page lists the tests currently in quarantine. Until now, removing several of them at once was only possible from Detection, the page that lists unhealthy tests — so cleaning out stale quarantines meant finding each test there first. Mitigation now lets you tick several quarantined tests and remove them from quarantine in one action. The list and the quarantine figures update in place. Pull request: \[https://github.com/Mergifyio/monorepo\](https://github.com/Mergifyio/monorepo) (MRGFY-9440, number set once opened) --- # Unknown \--- title: "The merge queue no longer rebases fork pull requests on behalf of an account" date: 2026-09-29 tags: - Merge Queue - Deprecations description: "A queue rule that pairs update\_method: rebase with update\_bot\_account now refuses pull requests that come from a fork." --- Updating a queued pull request that comes from a fork with \`update\_method: rebase\` and an \`update\_bot\_account\` required Mergify to impersonate that account and force-push the fork's branch, because GitHub refuses an OAuth token on its rebase API for a fork. That capability was deprecated for removal on July 1, 2026, and it has now been removed. Affected pull requests are now refused when they are queued rather than while they are being updated, so one of them never embarks and never holds up the pull requests behind it. The check run names the removal and what to change. To keep queueing pull requests from forks, unset \`update\_bot\_account\` on the queue: with no account to impersonate, the update rebases through GitHub's API as Mergify. On a queue that does not merge with \`fast-forward\`, \`update\_method: merge\` works too. Queues that run their checks on a draft pull request are not affected, and neither is \`update\_method: rebase\` without an \`update\_bot\_account\`. --- # Unknown \--- title: "Head branch updates stay inside your repository and its forks" date: 2026-09-08 tags: - Workflow Automation description: "The update, rebase and squash actions now refuse to write a head branch that lives in a repository yours was forked from." --- The \`update\`, \`rebase\` and \`squash\` actions and commands write a pull request's head branch. On a cross-repository pull request that branch belongs to another repository, and Mergify now checks which one before writing it: the head branch must live in your repository or in a fork of it. This closes a case where a pull request opened the other way round, from a fork with the fork as base and the upstream as head, had Mergify push to the upstream's own branches with the fork's credentials. Two narrow flows change as a result, both only for a repository that is itself a fork of another one. It can no longer update a head branch in a fork it cannot read, such as a private fork outside its Mergify installation. And it can no longer update a head branch in a fork more than one level below it, since only the head repository's immediate parent and the root of its fork network are compared. In both cases Mergify reports why on the pull request instead of pushing, and a pull request in that shape is refused at queue entry rather than dequeued later. --- # Unknown \--- title: Implementing a Two-Step CI with Mergify description: Run essential tests on every PR and comprehensive tests before merging, optimizing CI time and resources. --- Split your CI into fast preliminary checks on every PR and full tests that run only before merging. :::tip Understand the concepts behind two-step CI at the \[Merge Queue Academy\](https://merge-queue.academy/features/two-step-ci/). ::: \## The Two Phases \*\*Step 1: Preliminary tests\*\* run on every PR push: linters, formatters, unit tests, basic compile checks. Fast feedback, cheap to run. \*\*Step 2: Pre-merge tests\*\* run only when a PR enters the merge queue: integration tests, end-to-end tests, performance benchmarks. Thorough but expensive. ## How It Works \`\`\`dot class="flow" title="Two-step CI: cheap checks before the queue, the expensive ones inside it" digraph { node \[width=2.2\]; open \[label="Pull request opened\\nor updated", class="external"\]; preliminary \[label="Preliminary tests\\n(unit tests, linting)", class="pending"\]; preliminary\_ok \[label="Tests passed\\nready for the queue", class="merged"\]; preliminary\_fail \[label="Tests failed\\nneeds fixes", class="failed"\]; queue\_req \[label="Queue command\\n(@mergifyio queue)", class="queued"\]; queued \[label="Pull request queued", shape=oval, class="queued"\]; premerge \[label="Pre-merge tests\\n(integration, performance)", class="pending"\]; premerge\_ok \[label="All tests passed\\nready to merge", class="merged"\]; premerge\_fail \[label="Pre-merge failed\\nremoved from the queue", class="failed"\]; merged \[label="Merged to main", class="merged"\]; open -> preliminary; preliminary -> preliminary\_ok \[class="merged"\]; preliminary -> preliminary\_fail \[class="failed"\]; preliminary\_ok -> queue\_req; queue\_req -> queued; queued -> premerge; premerge -> premerge\_ok \[class="merged"\]; premerge -> premerge\_fail \[class="failed"\]; premerge\_ok -> merged \[class="merged"\]; { rank=same; preliminary\_ok; preliminary\_fail; } { rank=same; premerge\_ok; premerge\_fail; } } \`\`\` ## Batch Processing Enable \[batching\](/merge-queue/batches) to run pre-merge tests \*\*once\*\* for a group of PRs instead of per PR. For 5 PRs with a 30-minute pre-merge suite, that's 30 minutes instead of 2.5 hours. ## Configuration ### CI System Run pre-merge tests only on merge queue branches. Mergify creates branches prefixed with \`mergify/merge-queue/\` (customizable via \`queue\_branch\_prefix\` in \[\`queue\_rules\`\](/configuration/file-format/#queue-rules)). #### GitHub Actions \`\`\`yaml name: CI on: pull\_request: branches: - main jobs: # STEP 1: Preliminary tests (runs on every PR) preliminary-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run linters run: make lint - name: Run unit tests run: make test-unit # STEP 2: Pre-merge tests (runs only on merge queue branches) pre-merge-tests: if: startsWith(github.head\_ref, 'mergify/merge-queue/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run integration tests run: make test-integration - name: Run E2E tests run: make test-e2e - name: Run performance benchmarks run: make benchmark \`\`\` #### Other CI Systems - \*\*CircleCI\*\*: Branch filter regex \`/^mergify\\/merge-queue\\/.\*/\` - \*\*Jenkins\*\*: Conditional execution on \`BRANCH\_NAME\` - \*\*GitLab CI\*\*: \`only: /^mergify\\/merge-queue\\/.\*/\` ### Mergify \`\`\`yaml queue\_rules: - name: default # PRs can enter the queue after preliminary tests pass queue\_conditions: - check-success=preliminary-tests # PRs can merge only after pre-merge tests pass merge\_conditions: - check-success=pre-merge-tests \`\`\` \`queue\_conditions\` gates entry into the queue; \`merge\_conditions\` gates the final merge to main. --- # Unknown \--- title: Migrate from Bulldozer to Mergify description: Move from Bulldozer automerge to Mergify's Merge Queue for safer, faster merges. --- \[Bulldozer\](https://github.com/palantir/bulldozer) focuses on automerging pull requests based on labels, reviews, and status checks. Mergify's \[Merge Queue\](/merge-queue) covers that and more, with automatic PR updates, prioritization, batching, and parallel checks. This page shows a practical path to move from Bulldozer to Mergify's Merge Queue. :::tip\[Need help?\] We've migrated many teams from Bulldozer. \[Reach out\](mailto:support@mergify.com) and we'll review your Bulldozer configuration and propose an equivalent Mergify setup. ::: ## Typical Migration Plan 1. Keep your labels and branch protections as-is 2. Set up a Mergify merge queue with conditions matching your Bulldozer config 3. Start with a low-impact setup and expand gradually ## Common Bulldozer config → Mergify Merge Queue Example Bulldozer snippet: \`\`\`yaml merge: trigger: label: \["merge when ready"\] branch\_patterns: \["feature/.\*"\] method: squash required\_statuses: - "ci/circleci: ete-tests" \`\`\` Equivalent Mergify configuration: \`\`\`yaml title=.mergify.yml merge\_protections\_settings: auto\_merge\_conditions: - label = merge when ready - head ~= ^feature/ merge\_protections: - name: bulldozer-equivalent if: - base = main - head ~= ^feature/ success\_conditions: - "check-success = ci/circleci: ete-tests" queue\_rules: - name: default merge\_method: squash \`\`\` :::note The \`merge\_protections\` and \`merge\_protections\_settings\` sections above need \[Merge Protections\](/merge-protections/setup) enabled on the repository. With that product off, Mergify does not evaluate the \`merge\_protections\` rules and \`auto\_merge\_conditions\` has no effect, so pull requests only reach the queue through the \[\`@mergifyio queue\`\](/commands/queue) command. ::: Notes: - \[\`auto\_merge\_conditions\`\](/merge-protections/auto-merge) is where Bulldozer's \`trigger\` goes: a pull request that matches it is queued without anyone commenting \[\`@mergifyio queue\`\](/commands/queue). Set the field to \`true\` instead and every pull request is queued, including ones that match no \[merge protection\](/merge-protections) rule. Those reach the queue gated by your branch protections and the queue's own \`queue\_conditions\` alone - Bulldozer's \`required\_statuses\` become \`check-success = \` conditions (or \`check-skipped\`, \`check-neutral\`) under \`success\_conditions\`, where they gate both entry to the queue and the merge - Required labels map to \`label = \` conditions - Approvals map to review count or specific reviewers - The merge queue keeps PRs updated automatically, so no manual rebases are needed ## Going Further with Merge Queue Once you have basic automerge working, you can take advantage of features Bulldozer doesn't offer: - \[Priorities\](/merge-queue/priority): urgent PRs jump ahead in the queue - \[Batches\](/merge-queue/batches): merge multiple PRs at once to reduce CI load - \[Parallel checks\](/merge-queue/performance#parallel-checks): test multiple queue entries simultaneously ## Feature parity quick table - Merge methods: squash/merge/rebase → supported via \`merge\_method\` - Delete branch after merge → use GitHub's "Automatically delete head branches" repository setting - Rebase/update before merge → automatic in merge queue - Require labels → \`label =\` in \`auto\_merge\_conditions\` to trigger the queue, or in \`success\_conditions\` to require the label as a merge protection - Restrict by authors/paths → \`author =\`, \`files ~=\`, etc. in \`success\_conditions\` or \`if\` --- # Unknown \--- title: Migrate from Bors-NG to Mergify description: Map Bors-NG try/staging queues and permissions to Mergify rules and Merge Queue. --- Bors-NG orchestrates a "try → staging → master" flow with batch testing and ordered merges. Mergify offers a Merge Queue with similar guarantees plus flexible rules. :::tip\[Need help?\] We've migrated many teams from Bors-NG. \[Reach out\](mailto:support@mergify.com) and we'll review your Bors-NG configuration and propose an equivalent Mergify setup. ::: ## Typical Migration Plan - Keep your branch protection and checks - Define one queue rule in \`.mergify.yml\` - Replace \`bors r+\` approvals with the \`@mergifyio queue\` command ## Concepts mapping - \`bors r+\` approval → \[\`@mergifyio queue\`\](/commands/queue) command - batch size → Mergify batches with configurable size - priority → Mergify queue priorities ## Minimal equivalent configuration A queue that only accepts approved pull requests whose checks pass: \`\`\`yaml title=.mergify.yml queue\_rules: - name: default batch\_size: 1 queue\_conditions: - base = main - check-success = ci - "#approved-reviews-by>=1" \`\`\` \`queue\_conditions\` gates entry to the queue rather than triggering it: a pull request that matches them is queued once somebody runs \`@mergifyio queue\`, which is what \`bors r+\` maps to. To have Mergify queue pull requests on its own rather than on that command, set up \[Auto-Merge\](/merge-protections/auto-merge). :::tip Use \`batch\_size > 1\` to emulate Bors batches. ::: ## Emulating "try" builds If you relied on \`bors try\` to validate speculative changes, you can keep a lightweight CI workflow triggered by a label or comment. ## Batches and priorities Increase throughput with batches and prioritize urgent PRs: \`\`\`yaml queue\_rules: - name: default batch\_size: 3 queue\_conditions: - base = main - check-success = ci - "#approved-reviews-by>=1" priority\_rules: - name: urgent conditions: - label = urgent priority: high \`\`\` --- # Unknown \--- title: Compare Stacking Tools description: Honest comparisons between Mergify Stacks and other stacked PR tools. --- Each stacking tool makes different trade-offs around workflow complexity, Git model, platform integration, and collaboration support. These pages give you an honest look at how Mergify Stacks compares so you can pick what fits your team. Stacking by hand with \`git rebase\` and \`gh pr create\`. The baseline every other tool is measured against. GitHub's native stacking CLI. Multi-branch model with GitHub UI integration. A developer workflow platform with stacked PRs, custom review UI, and AI reviews. --- # Unknown \--- title: Migrate from GitHub Merge Queue to Mergify description: Technical mapping of GitHub Merge Queue concepts to Mergify with added capabilities. --- GitHub's native Merge Queue ensures each PR is tested against the latest base before merging. Migrating to Mergify keeps that guarantee while adding fine-grained policies, batching strategies, real CI efficiency insights, and queue observability (latency, throughput, bottlenecks) in one system. This guide shows a minimal, incremental migration: no rewrites, and you keep your branch protections and required checks exactly as they are. :::tip\[Need help?\] We've migrated many teams from GitHub Merge Queue. \[Reach out\](mailto:support@mergify.com) and we'll review your GitHub configuration and propose an equivalent Mergify setup, plus quick wins (batching, priorities, etc). ::: ## When to move beyond GitHub Merge Queue Choose Mergify if you need any of: - Multiple queue policies (e.g., different batch sizes / update methods per directory or label) - Conditional enqueue rules (labels, file globs, author, commit message, path ownership) - Explicit priorities (interactive hotfix elevation) - Parallel speculative checks (reduce head-of-line blocking) - Batching by size, with automatic splitting when a batch fails - \[Queue metrics\](/merge-queue/monitoring): queue time, CI runtime, batch outcomes, and where a pull request's time in the queue goes - Integrated workflow actions (label, rebase, backport, deployment gating) without extra bots ## Concept mapping While Mergify offers more features, here is a mapping of existing GitHub Merge Queue features: | GitHub Merge Queue | Mergify | | ------------------- | ------- | | Single queue per protected branch | One or more \`queue\_rules\` with conditions | | Merge Group (= test head + base) | \[Batch\](/merge-queue/batches), checked in place or on a draft pull request | | Required status checks | Injected from your ruleset or branch protections, or \`check-success\` in \`queue\_conditions\` | | Strict update before merge | \`update\_method\` (merge/rebase) + automatic refresh | ## Minimal equivalent configuration If today you rely on a protected \`main\` with a GitHub Merge Queue, no Mergify configuration is needed. Mergify automatically injects your ruleset or branch protections into the queue system. Type \[\`@mergifyio queue\`\](/commands/queue) to queue a pull request. This reproduces the same invariant: every PR merged only after re-validation on the latest \`main\`. :::caution While a \`merge\_queue\` ruleset rule is active on \`main\` and Mergify is not a bypass actor on that ruleset, GitHub refuses every merge Mergify performs outside its own queue, and Mergify's queue reports a configuration error instead of merging. Either remove that rule from the ruleset, or add Mergify as a bypass actor with the \`exempt\` bypass mode, which lets Mergify merge directly while GitHub's queue stays active for everyone else. See \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets#github-native-merge-queue-rule). ::: ## Batching & parallelism Increase throughput by validating multiple PRs together. Start conservatively: \`\`\`yaml queue\_rules: - name: main batch\_size: 2 \`\`\` If a batch fails, Mergify automatically reduces scope and isolates the culprit PRs without manual intervention. ## Priorities Enable urgent hotfix merges without draining the whole queue using \[priorities\](/merge-queue/priority): \`\`\`yaml priority\_rules: - name: critical conditions: - label = hotfix priority: high \`\`\` Apply a \`hotfix\` label and those pull requests move ahead of everything still waiting. By default they are inserted just after the pull requests whose checks are already running, so no CI time is thrown away; set \[\`allow\_checks\_interruption\`\](/merge-queue/priority#managing-check-interruptions-based-on-priority) to \`true\` on the rule to cut the line instead. ## Observability & reporting The \[Statistics page\](/merge-queue/monitoring) reports on the queue: - \*\*Max Queue Size\*\* and \*\*Average Queue Time\*\*, for how deep the queue gets and how long a pull request waits in it - \*\*Time Breakdown\*\*, splitting that wait across CI capacity, schedule windows, freeze periods, and CI runtime - \*\*Batch Outcomes\*\* and \*\*Batch Bisection Count\*\*, for how often batches fail and have to be split - \*\*Batches Saved\*\*, for batches that merged without running their own speculative checks - \*\*Average CI Runtime\*\*, for how long the checks the queue triggers take Use this data to tune batch size, break down monolithic checks, or add \[two-step CI\](/merge-queue/two-step) (fast + full) to shorten average cycle time. ## Incremental migration strategy 1. If needed, add the \`.mergify.yml\` configuration file with a \`queue\_rules\` block 2. Add Mergify as a bypass actor with the \`exempt\` bypass mode on the ruleset carrying the \`merge\_queue\` rule, so Mergify can merge while GitHub's queue stays active for everyone else 3. Queue a low-risk PR using \`@mergifyio queue\` 4. Compare timing & merge behavior 5. Remove the \`merge\_queue\` rule once satisfied and rely solely on Mergify 6. Layer in batching, priorities, additional rules Rollback is a settings change: drop the bypass actor entry, or put the \`merge\_queue\` rule back if you already removed it, and every merge goes through GitHub's queue again. Your branch protections and required checks are never rewritten, so nothing has to be restored. ## FAQ \*\*Does Mergify require removing branch protections?\*\* No. Keep them; Mergify injects their conditions into the queue itself, so you do not have to restate them. Listing the same check in both a branch protection and \`queue\_conditions\` is harmless: it does not make the check run twice. The \`merge\_queue\` ruleset rule is the exception, along with a handful of other rules the queue cannot work under; \[GitHub Rulesets Compatibility\](/merge-queue/github-rulesets#known-incompatibilities) lists them and what to do about each. \*\*Do I lose the merge squash/rebase options?\*\* No. Configure \`merge\_method\` per rule; you can still vary merge strategies across PR subsets. \*\*Is there vendor lock-in?\*\* Config is a single YAML file; removal falls back to native GitHub behavior immediately. --- # Unknown \--- title: Concepts description: How Mergify Stacks maps Git commits to GitHub pull requests. --- ## The Mental Model You work on one local branch with multiple commits. Mergify Stacks maps each commit to its own GitHub pull request. The PRs are chained together: each one's base branch is the previous PR's head branch. Reviewers see one small, focused diff per PR instead of the accumulated changes of the entire branch. When you run \`mergify stack push\`, each commit goes through three stages: Your local commits become remote branches, and each remote branch becomes a pull request. The Change-Id in each commit message is what ties all three together. ## Change-Id The Change-Id connects your local commits to their corresponding pull requests. It's a unique identifier embedded as a \[Git trailer\](https://git-scm.com/docs/git-interpret-trailers) in each commit message: \`\`\`text feat: add user authentication Implement JWT-based auth with refresh tokens. Change-Id: Ia1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2 \`\`\` The Change-Id is: - Generated automatically by a \`commit-msg\` Git hook installed during \[setup\](/stacks/setup) - Persistent across rebases, amends, and history rewrites - The mapping key that Stacks uses to know which commit corresponds to which PR, even after you rewrite your branch You never need to manage Change-Ids manually. They're created once and preserved through all git operations. ## Branch Mapping When you run \`mergify stack push\`, each commit gets its own remote branch. The naming convention is: \`\`\`text stack/{username}/{branch-name}/{commit-slug}--{change-id} \`\`\` \`{commit-slug}\` is derived from the commit title: the conventional commit prefix is stripped, stop words are removed, and common words are abbreviated. \`{change-id}\` is the first 8 hex characters of the commit's Change-Id, which keeps names unique when commit titles repeat. For example, if user \`alice\` pushes a branch called \`feat/auth\` with 3 commits: | Commit title | Remote Branch | |--------|--------------| | \`feat: add user data model\` | \`stack/alice/feat/auth/add-user-data-model--a1b2c3d4\` | | \`feat: add registration endpoint\` | \`stack/alice/feat/auth/add-registration-endpoint--d4e5f6a7\` | | \`test: add registration tests\` | \`stack/alice/feat/auth/add-registration-tests--b7c8d9e0\` | Readable branch names make \`git branch -a\`, \`gh pr list\`, and GitHub's branch dropdown easier to scan. You can customize the branch prefix via \[Git config\](/stacks/setup#configuration): \`\`\`bash git config mergify-cli.stack-branch-prefix "my-prefix" \`\`\` \`--branch-prefix\` overrides it for a single run. It is accepted by \`mergify stack push\` and by the commands that read the stack back (\`mergify stack list\`, \`mergify stack open\` and \`mergify stack sync\`), so a prefix passed on the command line has to be repeated on each of them. Set the Git config if you would rather not. \`mergify stack checkout\` takes no prefix: it resolves the stack from the branch name or PR URL you give it, no matter who pushed it. ## PR Chaining Each PR targets the previous PR's branch as its base, creating a dependency chain: | Commit | PR Base | PR Head | |--------|---------|---------| | A (first) | \`main\` | \`.../add-user-data-model--a1b2c3d4\` | | B (second) | \`.../add-user-data-model--a1b2c3d4\` | \`.../add-registration-endpoint--d4e5f6a7\` | | C (third) | \`.../add-registration-endpoint--d4e5f6a7\` | \`.../add-registration-tests--b7c8d9e0\` | Stacks posts a stack comment on every PR listing the full chain, and, when the push does not register the stack with GitHub's own stacking API, adds a \`Depends-On: #NNN\` reference in each PR description: ![Stack comment showing all PRs in the chain](https://docs.mergify.com/stacks/%7BStackComment%7D) The stack comment shows where each PR sits in the chain, with links to jump between them. This gives both authors and reviewers a clear map of the entire change. The \`Depends-On: #NNN\` marker isn't only for humans. The \[Merge Queue\](/merge-queue/stacks) also uses it to recognize a stack and queue it as a unit. Without the branch chain, the \`Depends-On:\` marker, and head branches in the repository the stack targets, the queue treats each PR independently. \`mergify stack push --no-github-native\` satisfies all three, which is why a stack is pushed to the repository itself rather than to a fork. A stack registered with GitHub's own stacking API is the exception, and \`mergify stack push\` registers one unless you pass \[\`--no-github-native\`\](/stacks/setup#configuration). GitHub holds the ordering there, so the descriptions carry no \`Depends-On:\` marker and the queue recognizes the PRs as a \[GitHub-native stack\](/merge-queue/stacks#github-native-stacked-pull-requests) instead. The queue moves it as a unit all the same: queueing one member queues the members below it, and they land from the bottom up. ## Smart Updates When you push again after making changes, Stacks doesn't recreate everything. It compares each commit's Change-Id and SHA against what's already on GitHub: - Changed commits get their PR updated (force-push to the remote branch) - Unchanged commits are skipped entirely - Removed commits (after squashing or dropping) get their orphan remote branches deleted automatically \`mergify stack push\` is always safe to run. It only does the minimum work needed to sync your local branch with GitHub. ## Next Steps See \[Setup\](/stacks/setup) to install the CLI and configure your repository. --- # Unknown \--- title: Updating Stacks description: Amend, reorder, add, or remove commits in your stack. --- After pushing a stack, you'll need to make changes: responding to review feedback, adding commits, rearranging order, or squashing. This page covers every common scenario. In all cases, the workflow is the same: \*\*edit your stack locally, then run \`mergify stack push\`\*\* to sync with GitHub. Stacks ships dedicated commands for every common history rewrite, so you don't have to drive \`git rebase -i\` by hand. Each editing command accepts a commit as either a short SHA or a \[Change-Id\](/stacks/concepts#change-id) prefix. Most of them also support \`--dry-run\` (\`-n\`) to print the plan without touching your branch. The \[\`stack\` CLI reference\](/cli/stack) has the full argument list for each one. \`mergify stack push\` rebases your branch on its base branch before pushing, but only while no PR in the stack carries an approval. Once a reviewer has approved, it pushes without rebasing, because rebasing would dismiss that review. Pass \`--force-rebase\` to rebase anyway and accept the dismissals, or \`--skip-rebase\` (\`-R\`) to never rebase. ## Amend the Latest Commit Make your changes, then amend: \`\`\`bash git add src/api/users.py git commit --amend \`\`\` The Change-Id is preserved automatically. Then push: \`\`\`bash mergify stack push \`\`\` Only the PR corresponding to the amended commit is updated. ## Edit a Commit Mid-Stack To modify a commit that isn't at the top of your branch, point \`mergify stack edit\` at it. Pass a short SHA or Change-Id prefix and the rebase pauses on that commit: \`\`\`bash mergify stack edit a1b2c3d \`\`\` Git stops at the target so you can make changes: \`\`\`bash # Make your changes git add src/models/user.py git commit --amend git rebase --continue \`\`\` Then push: \`\`\`bash mergify stack push \`\`\` Only the amended commit's PR (and any later PRs whose content shifts) is updated. ## Reword a Commit Message To change a commit's message without touching its contents: \`\`\`bash mergify stack reword d4e5f6a -m "feat: add user registration API endpoint" \`\`\` The Change-Id is preserved, so the PR keeps its identity. Because Stacks derives the PR title and body from the commit message, the corresponding PR's title and body update on the next push. ## Reorder Commits List every commit in the order you want, by SHA or Change-Id prefix: \`\`\`bash mergify stack reorder d4e5f6a a1b2c3d b7c8d9e \`\`\` To move a single commit without listing the whole stack, use \`move\` with \`first\`, \`last\`, \`before\`, or \`after\`: \`\`\`bash mergify stack move b7c8d9e first mergify stack move a1b2c3d after d4e5f6a \`\`\` The PRs re-chain automatically when you push. :::caution Reordering can cause conflicts if later commits depend on earlier ones. Git pauses and asks you to resolve conflicts during the rebase. ::: ## Add a Commit Just commit normally anywhere in your branch: \`\`\`bash git add src/api/auth.py git commit -m "feat: add authentication middleware" \`\`\` On the next \`mergify stack push\`, a new PR is created and inserted at the correct position in the chain. ## Remove a Commit Drop one or more commits by SHA or Change-Id prefix: \`\`\`bash mergify stack drop d4e5f6a \`\`\` On push, the orphan remote branch is deleted and the remaining PRs re-chain. ## Squash or Fixup Commits To fold a commit into its parent and \*\*drop\*\* its message, use \`fixup\`: \`\`\`bash mergify stack fixup b7c8d9e \`\`\` To combine commits into a target while \*\*keeping\*\* the target's message, use \`squash\`. Sources go before the \`into\` token, the target after it: \`\`\`bash mergify stack squash d4e5f6a into a1b2c3d \`\`\` Pass \`-m\` to rewrite the resulting message instead of keeping the target's: \`\`\`bash mergify stack squash d4e5f6a into a1b2c3d -m "feat: add user model and endpoint" \`\`\` The surviving commit keeps its Change-Id, so the corresponding PR is updated. The absorbed commit's remote branch is cleaned up automatically. ## Preview Before You Rewrite The history-rewriting commands (\`reword\`, \`reorder\`, \`move\`, \`drop\`, \`fixup\`, \`squash\`) accept \`--dry-run\` (\`-n\`) to print the resulting plan without changing your branch: \`\`\`bash mergify stack reorder d4e5f6a a1b2c3d b7c8d9e --dry-run \`\`\` ## Record Why You Amended When you amend a commit that already has a PR, reviewers see a new revision but not the reason behind it. Attach a note before pushing to explain the change: \`\`\`bash git commit --amend mergify stack note -m "address review: rename foo() to bar()" mergify stack push \`\`\` The note travels with the stack and appears in the PR's revision history, so reviewers understand what changed between revisions without diffing SHAs. See \[Reviewing Stacks\](/stacks/reviewing#revision-history) for the reviewer's view. By default, \`mergify stack push\` keeps a revision-history comment on each PR up to date. Pass \`--no-revision-history\` (or set \`mergify-cli.stack-revision-history\` to \`false\`) to turn it off. ## After a PR Merges When the bottom PR in your stack merges into \`main\`, bring your local branch back in sync: \`\`\`bash mergify stack sync \`\`\` \`sync\` fetches the latest \`main\`, detects which commits already merged, drops them from your branch, and rebases the rest. Then push to update the remaining PRs: \`\`\`bash mergify stack push \`\`\` Before the merge, your stack looks like this: After PR #1 merges, commit A lands on \`main\`. The remaining PRs re-chain: \`sync\` rebases on \`main\`, detects that the merged commit is already there, and skips it. The remaining PRs update as needed on the next push. --- # Unknown \--- title: Team Adoption description: Why and how to roll out stacked PRs across your engineering team. --- ## Why Stacked PRs Matter for Teams Code review slows down as PRs get bigger. Reviewers spend less time per line as the diff grows: a 400-line PR gets a thorough review, a 2,000-line PR gets a skim and an approval. As teams adopt AI coding tools, the amount of code generated per developer is increasing faster than anyone can review it. Stacked PRs let developers ship large changes as a series of small, reviewable units instead of one monolith. The difference shows up in practice: - Faster review cycles: small PRs get reviewed in hours, not days - Higher review quality: reviewers catch more issues in focused diffs - Faster unblocking: developers can start the next piece while the first is in review - Easier rollbacks: revert one small PR instead of unwinding a monolith ## Gradual Rollout Stacks doesn't require a team-wide rollout. There's no repo-wide configuration and no CI changes. A single developer can start using stacks today: 1. \[Install the CLI\](/cli/usage) locally 2. Give it a \[GitHub token\](/cli/usage#github-token-for-stacks), or authenticate the GitHub CLI 3. Run \[\`mergify stack setup\`\](/stacks/setup) in their clone 4. Start pushing stacks The one repository setting that matters is \[Automatically delete head branches\](/stacks/setup#3-configure-github). It clears merged stack branches, and for a stack pushed with \[\`--no-github-native\`\](/stacks/setup#configuration) it also lets GitHub retarget each PR onto \`main\` as the one below it merges. Someone with admin rights turns it on once. Their teammates review the resulting PRs normally. They just see smaller, well-organized PRs with stack comments explaining the chain. No one else needs to install anything. As more developers see the benefits in review, adoption spreads naturally. ## Working on Someone Else's Stack If a teammate has pushed a stack and you want to pick it up locally (to help, pair, or continue the work), point \`checkout\` at any PR in it: \`\`\`bash mergify stack checkout https://github.com/owner/repo/pull/142 \`\`\` Any PR in the stack identifies the whole chain, so one from the middle works as well as the tip. The URL carries the repository, which means \`--repository\` is ignored when you check out this way. You can also name the stack's remote branch instead of passing a URL. The local branch is named after the stack's branch with your own \[branch prefix\](/stacks/setup#configuration) stripped off. The default prefix contains your username, so a teammate's stack isn't under it and the name falls back to the branch's last segment. Pass \`--branch\` to choose the name yourself. This reconstructs the stack locally by fetching the remote branches and rebuilding the commit chain. You can then make changes and push updates with \`mergify stack push\` as usual. ## When to Use Stacks Not every change needs a stack. Use stacks when the alternative is a large, hard-to-review PR: \*\*Good candidates:\*\* - Features touching multiple layers (model, API, UI) - Large refactors that can be broken into logical steps - AI-generated changes that need careful human review - Any change that would exceed ~300 lines in a single PR \*\*Skip stacks for:\*\* - One-line bug fixes - Documentation-only changes - Simple configuration updates - Changes that are already small and focused ## Pairing with Merge Queue \[Merge Queue\](/merge-queue) understands stacks natively. A single \`@mergifyio queue\` on the top PR enqueues the whole stack in order; the queue keeps stacked PRs together when batching, and dequeuing a PR also dequeues the PRs above it. See \[Stacked PRs in the Merge Queue\](/merge-queue/stacks) for the full mechanics. ## Comparing with Alternatives Several tools offer stacked PRs, each with different trade-offs around workflow complexity, branch management, platform integration, and collaboration support. See the \[detailed comparisons\](/stacks/compare) for an honest look at how Mergify Stacks measures up against alternatives, from plain Git to gh-stack and Graphite. --- # Unknown \--- title: Mitigation description: Quarantine problematic tests to unblock CI without losing visibility. --- When a flaky or broken test blocks CI, teams face a tough choice: fix it immediately, delete it, or ignore it. Quarantine offers a better option. The test keeps running, but its failures no longer block merges. You maintain full visibility without disruption. ![Mitigation dashboard: quarantine metrics and quarantined-tests list](https://docs.mergify.com/test-insights/%7BMitigationScreenshot%7D) ## How quarantine works A quarantined test still executes in your CI pipeline and its results are still collected by Mergify. The difference is that failures are ignored for merge decisions. This means: - Your CI stays green while you work on a fix - Historical data is preserved, so you can track whether the test improves or worsens over time - Other team members can see the test is quarantined and why Quarantine works on any branch, not just the default branch. :::note Quarantined tests must still be uploaded through one of the supported CI integrations. See the \[test framework configuration\](/test-insights#test-framework-configuration) for setup details. ::: ## Manual quarantine You can manually add or remove specific tests from quarantine through the Mergify dashboard. This is useful when you've identified a problematic test through \[Detection\](/test-insights/detection) and want to stop it from blocking your team while you investigate. For technical details on how quarantine integrates with your CI pipeline, see the \[Quarantine documentation\](/test-insights/quarantine). ## Auto-quarantine Auto-quarantine lets Mergify automatically quarantine tests without manual intervention. By default, only flaky tests are quarantined automatically. You can also enable quarantining of known broken tests through an additional option. This is useful for teams that want hands-off management of unreliable tests. You can enable or disable auto-quarantine per repository from the Mitigation page in the dashboard. ## Practical workflows ### Quarantining a test from Detection When you identify a high-impact flaky or broken test in \[Detection\](/test-insights/detection), you can quarantine it directly to stop it from blocking merges while you work on a fix. ### Reviewing quarantined tests Periodically check the Mitigation page to review quarantined tests. Look for tests whose health status has improved; these may be ready to be removed from quarantine. ### Enabling auto-quarantine For repositories where broken tests frequently block CI, enable auto-quarantine to let Mergify handle it automatically. This reduces manual overhead and keeps your CI pipeline moving. ## Setup Mitigation uses the same CI integration as Detection. To ensure quarantine works correctly, your CI must be configured to check quarantine status. See the \[Quarantine documentation\](/test-insights/quarantine) for technical setup details. --- # Unknown \--- title: Detection description: Identify and prioritize unhealthy tests across your repositories. --- Even with prevention in place, tests can degrade over time. Detection surfaces all unhealthy tests (flaky and broken) across your repositories, so you can see the full picture and prioritize what to fix. ![Detection dashboard: tests health donut and CI impact chart](https://docs.mergify.com/test-insights/%7BDetectionScreenshot%7D) ## Which runs Detection reports on Detection reports on tests that ran on your repository's default branch. Results uploaded from pull request branches are stored, but they do not contribute to the metrics shown here. A repository whose CI has only ever run on pull requests shows an empty Detection page, even though uploads are working. Merge to the default branch and the tests appear after that run completes. The same scope applies outside the dashboard: the \[\`mergify tests show\`\](/cli/tests) command and the \[test search API\](/api/test-insights) return default-branch results. \[Prevention\](/test-insights/prevention) covers the pull request side of Test Insights: it reports on tests running on pull request branches. ## How tests are classified Mergify classifies a test from the results collected for it across CI runs: - \*\*Flaky\*\*: The test passed and failed close together on the same branch, pipeline, and job, so its outcome does not follow from the code alone. - \*\*Broken\*\*: The test failed and no result close in time contradicts those failures. A test whose runs all fail is always broken. An isolated failure among a large number of passing runs is not enough to make a test unhealthy. A test that has kept running, and passing, for a week since its last failure goes back to healthy, so a test you fixed stops being reported without waiting for its old failures to age out. Detection lists tests under a \*\*Flaky\*\*, \*\*Broken\*\*, or \*\*Healthy\*\* tab, so you can work through the unhealthy ones and still look up a healthy test. ## Understanding confidence Confidence indicates how much data is available to assess a test's health. It comes in three levels: - \*\*High\*\*: Enough runs have been collected to trust the health status. - \*\*Medium\*\*: A limited number of runs. The health status may still change. - \*\*Low\*\*: Very few runs, so the health status is unreliable. Treat low-confidence results as preliminary. Confidence increases as more CI runs are collected for a given test. ## Rerunning unhealthy tests Mergify can rerun unhealthy tests automatically so they reach high confidence sooner, instead of waiting for them to run again on their own. Reruns stay within a budget you control, which caps the extra CI time they add. This is opt-in per repository and requires a test framework plugin. Once a plugin is installed, set a rerun budget on the \[Detection page\](https://dashboard.mergify.com/test-insights/detection) in the dashboard to enable it. ## Prioritizing with impact Impact is the share of a test's executions that failed, reported as low, medium, or high. A test that fails on most of its runs has a higher impact than one that fails once in a while, whatever the absolute number of failures. Use impact to decide which tests to fix first: high-impact tests give you the most return on investment when fixed. ## Practical workflows ### Finding your worst tests Filter on high impact to surface the tests causing the most CI disruption. These are the best candidates for immediate attention. ### Narrowing scope Use filters to focus on specific areas: - \*\*Test name\*\*: Search for a specific test or pattern - \*\*Job name\*\*: Focus on tests within a particular CI job - \*\*Pipeline name\*\*: Narrow to a specific CI pipeline - \*\*Confidence\*\*: Keep only tests at a given confidence level - \*\*Impact\*\*: Keep only tests at a given impact level ### Checking quarantine status Tests that have already been quarantined are indicated in the health status. This helps you avoid spending time investigating tests that are already being managed through \[Mitigation\](/test-insights/mitigation). ## Setup Detection requires test metrics collection through repeated CI runs. See the CI setup guides for your platform: - \[GitHub Actions setup\](/ci-insights/setup/github-actions) - \[Buildkite setup\](/ci-insights/setup/buildkite) - \[Jenkins setup\](/ci-insights/setup/jenkins) --- # Unknown \--- title: Quarantine description: Ignore problematic tests in your CI --- The quarantine feature lets you isolate broken or flaky tests in your CI pipeline without removing them entirely. Once a test is quarantined, it will still run in your CI, but its failure will be ignored for the purposes of blocking merges or marking a pipeline as failed. This helps you keep your CI green while maintaining full visibility into test reliability and ongoing issues. ## How Quarantine Works When you quarantine a test in the Mergify dashboard, its future executions will continue to be collected by \[Test Insights\](/test-insights), but your CI will ignore failures. This avoids pipeline disruption while still surfacing issues in the UI and keeping historical data intact. Quarantined tests must still be uploaded appropriately using one of the supported CI integrations. To ensure the correct setup, refer to \[the documentation for your test framework\](/test-insights#test-framework-configuration). ## When Mergify Quarantines a Test Itself Mergify can also quarantine a test on its own, from the health status \[Detection\](/test-insights/detection) assigns it. You enable this \[auto-quarantine\](/test-insights/mitigation#auto-quarantine) per repository from the Mitigation page. It does not act on that status as soon as a test looks unhealthy: it waits until there is enough evidence behind the verdict. Three things have to hold. The test needs a reasonable number of recent executions to judge, it has to have been running long enough to have a pattern at all (a test whose whole history fits inside the last few minutes reads as one bad CI event rather than a flaky test), and a meaningful share of its runs has to have failed. That last floor is why a single failure among thousands of green runs never quarantines anything, however reproducible the rest of the pattern looks. A test that has not run for a while keeps whatever health status it last had, but Mergify stops spending \[reruns\](/test-insights/detection#rerunning-unhealthy-tests) on it, since no recent run backs that verdict any more. Until a test clears those bars, its status still shows on the dashboard and you can quarantine it yourself; Mergify will not do it for you. ## Adding and removing tests from quarantine ### From the Mergify Dashboard The \[Mitigation page\](https://dashboard.mergify.com/test-insights/mitigation) on the dashboard contains the list of tests that Test Insights collected from your CI runs. From there, you can add or remove a test from quarantine. ### From the Mergify CLI The \[Mergify CLI\](/cli/tests) can manage quarantines from the terminal, which is handy for scripting or for letting an AI coding agent quarantine a flaky test it just hit: \`\`\`bash # Quarantine a test. mergify tests quarantines add -r owner/repo \\ --reason "flaky under load, fix in progress" \\ "tests/auth/test\_login.py::test\_login\_timeout" # Remove it from quarantine. mergify tests quarantines remove -r owner/repo \\ "tests/auth/test\_login.py::test\_login\_timeout" # List everything currently quarantined. mergify tests quarantines list -r owner/repo \`\`\` See the \[\`tests\` CLI reference\](/cli/tests) for all flags and exit codes. ## Staying Notified Quarantine and dequarantine actions, whether you make them yourself or Mergify applies them automatically, are recorded as events you can review on the dashboard and act on. You can also have Mergify post them to a Slack channel as they happen: see \[Test Insights notifications\](/integrations/slack#test-insights-notifications) to set one up. --- # Unknown \--- title: Cypress Integration with Mergify description: Report your test results from Cypress to Mergify --- This guide shows how to configure \[Cypress\](https://www.cypress.io/) to produce JUnit reports and upload them to Test Insights using your CI workflow. ## Generate a JUnit Report with Cypress By default, Cypress doesn't generate JUnit-format test results. You need to enable it in your \`cypress.config.ts\` file. This is \[documented on the Cypress website\](https://docs.cypress.io/app/tooling/reporters). The best way to do this is to use \`cypress-multi-reporters\` so you can both have JUnit generated while keeping the standard output. 1. Add \`cypress-multi-reporters\` to your package file, e.g., \`npm install --save-dev cypress-multi-reporters mocha-junit-reporter\`. 2. Create a \`reporter-config.json\` at the top of your repository with this configuration: \`\`\`json { "reporterEnabled": "spec, mocha-junit-reporter", "mochaJunitReporterReporterOptions": { "mochaFile": "cypress/results/junit-\[hash\].xml" } } \`\`\` ## Update Your CI Workflow ### GitHub Actions Once you have the JUnit file produced by Cypress, add a step to upload these results to \*\*Test Insights\*\* via the \`mergifyio/gha-mergify-ci\` action. Give the step that runs Cypress an \`id\`, so the upload step below can report its outcome: \`\`\`yaml - name: Run Cypress Tests and Generate JUnit Report id: tests continue-on-error: true run: npm run test:cypress \`\`\` Then add the upload step after it: \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will run tests with Cypress. 2. Cypress generates JUnit files. 3. The Mergify CI action uploads that file to Test Insights. \## Troubleshooting Tips --- # Unknown \--- title: Go Integration with Mergify description: Report your test results from Go tests to Mergify --- This guide shows how to generate JUnit reports from your Go tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with Go Tests By default, \`go test\` does not output JUnit-format reports. To generate one, pipe the verbose test output into a tool like \[go-junit-report\](https://github.com/jstemmer/go-junit-report) or use \[gotestsum\](https://github.com/gotestyourself/gotestsum). ### Using go-junit-report \`\`\`bash go test -v ./... 2>&1 | go-junit-report > junit.xml \`\`\` ### Using gotestsum \`\`\`bash gotestsum --junitfile junit.xml \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to Test Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run Go Tests and Generate JUnit Report id: tests continue-on-error: true run: go test -v ./... 2>&1 | go-junit-report > junit.xml \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your Go tests. 2. A JUnit report (junit.xml) is generated. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips --- # Unknown \--- title: Jest Integration with Mergify description: Report your test results from Jest tests to Mergify --- This guide shows how to generate JUnit reports from your Jest tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with Jest Jest can output JUnit XML reports through the \`jest-junit\` reporter. You can enable it in your Jest configuration or with command-line options. ### Using Jest Configuration Add the following to your \`jest.config.js\` or \`package.json\`: \`\`\`javascript // jest.config.js module.exports = { reporters: \[ 'default', \['jest-junit', { outputDirectory: '.', outputName: 'junit.xml' }\] \] }; \`\`\` First, install the \`jest-junit\` reporter: \`\`\`bash npm install --save-dev jest-junit \`\`\` ### Using Command Line Options \`\`\`bash npx jest --reporters=default --reporters=jest-junit \`\`\` You can also set the output file location: \`\`\`bash JEST\_JUNIT\_OUTPUT\_DIR=. JEST\_JUNIT\_OUTPUT\_NAME=junit.xml npx jest --reporters=default --reporters=jest-junit \`\`\` ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run Jest Tests and Generate JUnit Report id: tests continue-on-error: true env: JEST\_JUNIT\_OUTPUT\_DIR: . JEST\_JUNIT\_OUTPUT\_NAME: junit.xml run: npx jest --reporters=default --reporters=jest-junit \`\`\` \### Buildkite \### Any CI (Mergify CLI) \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your Jest tests. 2. A JUnit report (\`junit.xml\`) is generated. 3. The Mergify CI action uploads the report to Test Insights. \## Troubleshooting Tips * Jest Configuration: Ensure \`jest-junit\` is properly installed and configured in your Jest setup. --- # Unknown \--- title: JUnit Integration with Mergify description: Report your test results from JUnit tests to Mergify --- This guide shows how to generate JUnit reports from your JUnit tests and upload them to \*\*Test Insights\*\* using your CI workflow. ## Generate a JUnit Report with JUnit JUnit naturally generates XML reports that are compatible with the JUnit format expected by Test Insights. You can configure your build tool to output these reports. ### Using Maven Configure the Surefire plugin in your \`pom.xml\`: \`\`\`xml org.apache.maven.plugins maven-surefire-plugin 3.5.3 ${project.build.directory}/surefire-reports \`\`\` Run tests with: \`\`\`bash mvn test \`\`\` The JUnit XML reports will be generated in \`target/surefire-reports/\`. ### Using Gradle Gradle's \`test\` task writes JUnit XML reports without any extra configuration. If your tests run on JUnit 5, enable the platform in your \`build.gradle\`: \`\`\`groovy test { useJUnitPlatform() } \`\`\` Run tests with: \`\`\`bash ./gradlew test \`\`\` The JUnit XML reports will be generated in \`build/test-results/test/\`. ## Update Your CI Workflow ### GitHub Actions After generating the JUnit report, add a step to upload the results to CI Insights using the \`mergifyio/gha-mergify-ci\` action. For example, in your workflow file: \`\`\`yaml - name: Run JUnit Tests and Generate Report id: tests continue-on-error: true run: mvn test \`\`\` Then, upload the report: For Gradle projects: \`\`\`yaml - name: Run JUnit Tests and Generate Report id: tests continue-on-error: true run: ./gradlew test \`\`\` \### Buildkite For Maven projects: For Gradle projects: \### Any CI (Mergify CLI) For Maven projects: For Gradle projects: \## Verify and Review in Test Insights After pushing these changes: 1. Your GitHub Actions workflow will execute your JUnit tests. 2. JUnit XML reports are generated by Maven/Gradle. 3. The Mergify CI action uploads the reports to Test Insights. \## Troubleshooting Tips * Build Tool Configuration: Ensure Maven Surefire or Gradle test reporting is properly configured to generate XML reports. --- # Unknown \--- title: Mergify Stacks vs Graphite description: An honest comparison of Mergify Stacks and Graphite's stacking workflow. --- \[Graphite\](https://graphite.dev/) is a developer workflow platform built around stacked pull requests. It ships a CLI (\`gt\`), a custom PR review UI, AI reviews, and a merge queue. This page focuses on how the two tools handle stacking: how you create, update, and land a chain of PRs. A short \[Beyond stacks\](#beyond-stacks) section near the end covers how the broader platforms differ. Both tools solve the same core problem (big PRs are hard to review, so split them into a chain of small ones), but they take different approaches to get there. ## Two Models for Stacking The biggest difference is how each tool thinks about branches. | | Mergify Stacks | Graphite | |---|---|---| | \*\*Local model\*\* | One branch, many commits | One branch per PR | | \*\*Identity\*\* | Change-Id trailer in commit message | Branch name | | \*\*Who manages branches\*\* | Mergify auto-creates remote branches | Developer creates and names them | | \*\*Mental model\*\* | "Chain of commits" | "Chain of dependent branches" | Both produce the same result on GitHub: chained PRs where each targets the previous one's branch. The difference is what you deal with locally. ### Mergify Stacks: one branch, many commits \### Graphite: one branch per PR You create and name a separate branch for each change with \`gt create\`. Each branch becomes a PR that targets the branch below it: Three branches, three PRs: \`add-model\` targets \`main\`, \`add-endpoint\` targets \`add-model\`, \`add-tests\` targets \`add-endpoint\`. You navigate between them with \`gt up\`, \`gt down\`, \`gt top\`, and \`gt bottom\`. ## Feature Comparison | Feature | Mergify Stacks | Graphite | |---|---|---| | Create a stack | \`mergify stack new \` + commits | \`gt create \[name\]\` per branch | | Push changes | \`mergify stack push\` (rebase + push + PRs) | \`gt submit\` (force-push + PRs) | | View the stack | \`mergify stack list\` | \`gt log\` | | Edit mid-stack | \`mergify stack edit \` (targeted pause) | \`gt modify\` (auto-restacks) | | Absorb fixups | Not supported | \`gt absorb\` (auto-routes staged hunks) | | Split a commit | Not supported | \`gt split\` (by commit, hunk, or file) | | Reorder changes | \`mergify stack reorder\` or \`mergify stack move\` | \`gt reorder\` (interactive) | | Squash / fold | \`mergify stack squash\` or \`mergify stack fixup\` | \`gt squash\` / \`gt fold\` | | Undo | Git reflog | \`gt undo\` (reverts recent \`gt\` operations) | | Sync after merge | \`mergify stack sync\` | \`gt sync\` | | Navigate between PRs | N/A (single branch) | \`gt up\` / \`down\` / \`top\` / \`bottom\` | | Open PR in browser | \`mergify stack open\` (interactive picker) | \`gt pr\` | | Collaboration | \`mergify stack checkout\` | Shared stacks + frozen branches | | Branch naming | Auto-generated (\[configurable\](/stacks/concepts#branch-mapping)) | Developer-chosen | | Alternate base branch | \`mergify stack new \--base /\` | Multi-trunk support | | IDE integration | CLI only | VS Code extension | | AI agent integration | \[Skills\](/stacks/agents) for Claude Code and skills.sh agents | \`gt mcp\` | | Merge Queue | \[Native Mergify integration\](/merge-queue) | Graphite merge queue | | Merge a stack | Bottom-up via Merge Queue | \`gt merge\` (stack-aware) | ## Where Mergify Is Stronger \*\*Simpler Git model.\*\* One branch, standard Git. You don't create branches or navigate between them. You commit and rebase like you already do. The branching complexity lives on the remote side where you don't have to think about it. Graphite's one-branch-per-PR model is more expressive but asks you to learn a new set of commands (\`gt up\`, \`gt down\`, \`gt modify\`, \`gt restack\`) and keep a tree of local branches in your head. \*\*One command does more.\*\* \`mergify stack push\` rebases on the target branch, pushes all changes, and creates or updates PRs in a single step. Graphite splits the flow across several operations (\`gt create\`, \`gt modify\`, \`gt submit\`) depending on where you are in the stack. \*\*Merge Queue depth.\*\* Mergify's Merge Queue has \[batching\](/merge-queue/batches), \[priority lanes\](/merge-queue/priority), \[speculative checks\](/merge-queue/performance#parallel-checks), and \[queue pause\](/merge-queue/pause). Graphite has a merge queue too; Mergify's is more configurable and has been in production longer. \*\*No one else needs Mergify.\*\* Only the stack author installs the CLI. Reviewers, teammates, and anyone else interacting with the PRs use GitHub's native UI: no Mergify sign-up, no install, no account required. Graphite's full review, navigation, and approval flow lives inside the Graphite app, so to get the complete experience everyone on the team needs a Graphite account. ## Where Graphite Is Stronger \*\*\`gt absorb\` saves real time.\*\* After a review round, you often need to amend several commits with different fixes. Graphite's \`gt absorb\` looks at your staged hunks and routes each one into the commit that last touched those lines. Mergify doesn't have an equivalent; you amend each commit by hand. \*\*\`gt split\` breaks big commits apart.\*\* When a commit grows too large during development, \`gt split\` carves it into smaller commits by file or hunk. Useful when what started as one change turns out to need separating for review. \*\*\`gt undo\` is a safety net.\*\* Graphite tracks its own operations and can revert them with a single command. Mergify relies on Git's reflog, which is harder to navigate when something goes sideways. \*\*Frozen branches for collaboration.\*\* Graphite can freeze branches that other contributors are working on to prevent accidental force-pushes. \`mergify stack checkout\` supports handoff too, but Graphite's explicit locking prevents more foot-guns on shared stacks. \*\*IDE integration.\*\* Graphite has a VS Code extension that lets you manage the stack visually. Mergify is CLI-only today. ## Beyond Stacks Stacking is one feature of Graphite, not all of it. The rest of the product includes: - \*\*AI reviews and Graphite Chat\*\*: automated review comments and an AI assistant that answers questions and edits code on PRs. - \*\*Custom PR review UI\*\*: inbox, code tours, diff versions, keyboard shortcuts. - \*\*Developer velocity analytics\*\*: PR throughput, review time, per-person metrics. - \*\*Native integrations\*\*: Linear, Slack (including review and merge from Slack). Mergify has invested in a different direction: - \*\*Rules engine\*\*: 70+ \[pull request attributes\](/configuration/conditions#attributes-list), 18 \[actions\](/workflow/actions), cascading logic for \[Workflow Automation\](/workflow). - \*\*Merge Queue maturity\*\*: batching, priority lanes, speculative checks, queue pause. - \*\*CI and test intelligence\*\*: \[CI Insights\](/ci-insights) for cost and timing analytics, flaky test detection, quarantine, and test reporting. - \*\*Open CLI, review in GitHub\*\*: Stacks works with GitHub's native review UI; there's no separate app to learn. If AI review and a custom PR experience are what you want, Graphite is built around that. If you want a deep Merge Queue, Workflow Automation, and CI/test intelligence, Mergify is built around that. For stacking alone, the choice comes down to the Git model and the feature gaps above. ## Other Considerations \*\*Pricing.\*\* The Mergify CLI and Stacks are free and work without a Mergify subscription. Graphite has a free tier for the CLI and charges for platform features (AI reviews, merge queue, analytics) on team and enterprise plans. \*\*Platform support.\*\* Both tools target GitHub today. \*\*Review surface.\*\* Graphite encourages review inside its own app. Mergify Stacks keeps review in GitHub's native UI, which matters if your team doesn't want to move PR review off GitHub. ## Switching from Graphite If you've been using Graphite and want to try Mergify Stacks, the main shift is moving from "one branch per PR" to "one commit per PR on a single branch." ### Install and setup This installs the CLI and adds a \`commit-msg\` hook that generates \[Change-Ids\](/stacks/concepts#change-id) for your commits. See the \[setup guide\](/stacks/setup) for details. ### Concept mapping | Graphite | Mergify Stacks | |---|---| | \`gt create\` (create a branch) | \`git commit\` (create a commit) | | \`gt modify\` | \`git commit --amend\` or \`mergify stack edit \` | | \`gt submit\` | \`mergify stack push\` | | \`gt up\` / \`down\` / \`top\` / \`bottom\` | Not needed (single branch) | | \`gt restack\` | Automatic on \`mergify stack push\` | | \`gt sync\` | \`mergify stack sync\` | | \`gt log\` | \`mergify stack list\` | | \`gt absorb\` | No direct equivalent (amend each commit by hand) | ### Workflow before and after \*\*With Graphite:\*\* \`\`\`bash gt create add-model # work on first change gt create add-endpoint # work on second change gt submit \`\`\` \*\*With Mergify Stacks:\*\* \`\`\`bash mergify stack new feat/my-feature git commit -m "add model" git commit -m "add endpoint" mergify stack push \`\`\` The result on GitHub is the same: two chained PRs, each showing one change. --- # Unknown \--- title: Mergify Stacks vs Plain Git description: An honest comparison of Mergify Stacks and stacking by hand with git rebase and gh pr create. --- You don't need a tool to stack pull requests. Git already lets you split work into a chain of commits, and \`gh pr create\` opens a PR for each one. Plenty of teams run a small shell wrapper around exactly that. This page is an honest look at what you give up, and what you get back, by letting Stacks manage the chain instead of doing it by hand. ## Stacking by Hand The manual recipe is straightforward, at least at first. You create a branch per change, rebase each branch onto the one below it, push them all, and open a PR for each with the right base: \`\`\`bash git checkout -b feat/model main # work, commit git checkout -b feat/endpoint feat/model # work, commit git checkout -b feat/tests feat/endpoint # work, commit git push -u origin feat/model feat/endpoint feat/tests gh pr create --base main --head feat/model gh pr create --base feat/model --head feat/endpoint gh pr create --base feat/endpoint --head feat/tests \`\`\` It works. The cost shows up later, every time the stack changes. Amend the bottom commit and you re-push three branches by hand. Reorder two changes and you rebase each dependent branch in turn. When the bottom PR merges, you re-target the next PR to \`main\` yourself and clean up the merged branch. Each of these is a few commands, and each is easy to get subtly wrong. ## One Branch Instead of a Tree Stacks keeps you on a single branch of ordinary commits. There are no per-PR branches to create, name, or rebase: A \[Change-Id\](/stacks/concepts#change-id) trailer (added by a \`commit-msg\` hook) ties each commit to its PR, so the mapping survives amends, rebases, and reorders. \`mergify stack push\` rebases on the target branch, pushes a remote branch per commit, opens or updates one PR each, and chains them in dependency order, in one command. ## Feature Comparison | Task | Plain Git + \`gh\` | Mergify Stacks | |---|---|---| | Model | One branch per PR, rebased in a tree | One branch, many commits | | Map commit to PR | You track which branch is which PR | Change-Id trailer, automatic | | Open PRs | \`gh pr create\` per branch, set each base | Included in \`mergify stack push\` | | Amend mid-stack | Rebase every dependent branch, re-push each | \`mergify stack edit \`, then push | | Reorder | Manual \`git rebase -i\` across branches | \`mergify stack reorder\` / \`mergify stack move\` | | Squash / drop | \`git rebase -i\`, then re-push affected branches | \`mergify stack squash\` / \`fixup\` / \`drop\` | | Push only what changed | You decide which branches to push | Smart updates: only changed PRs are touched | | After a merge | Re-target next PR, delete merged branch | \`mergify stack sync\` detects and drops merged commits | | Re-targeting on merge | Manual base change per PR | Automatic when the bottom PR lands | | Stack overview on the PR | None (or hand-written) | Stack comment + revision history on every PR | | Merge Queue | Per-PR, no stack awareness | \[Stack-aware queueing\](/merge-queue/stacks) | ## Where Plain Git Is Enough Stacks earns its keep on changes that span several commits and get reworked during review. If that's not your situation, the manual path is fine, and honestly simpler: - \*\*Your changes are already small.\*\* A one-commit fix is one PR. There's nothing to stack, so \`gh pr create\` is all you need. - \*\*You rarely reorder or amend mid-stack.\*\* The manual cost is in reworking a chain. If you push once and merge, you never pay it. - \*\*You only stack occasionally.\*\* For a one-off pair of dependent PRs, three \`gh\` commands beat installing a tool. Stacks doesn't change this calculus by force. Even with the CLI installed, a single small commit is still a single small PR. ## Where Mergify Is Stronger \*\*The chain maintains itself.\*\* Most of the work is keeping a stack correct through review, not creating it. Smart updates push only the PRs whose commits changed, re-targeting happens automatically as PRs merge, and \`mergify stack sync\` drops already-merged commits and rebases the rest. By hand, each of those is a manual step you can forget. \*\*Identity survives history rewrites.\*\* Because the Change-Id lives in the commit message, amending or reordering a commit keeps it mapped to the same PR. A hand-rolled script keyed on branch names loses that mapping the moment you rebase, which is why homegrown wrappers tend to recreate PRs or orphan branches. \*\*Reviewers get context for free.\*\* Every PR carries a stack comment and a revision-history timeline showing where it sits in the chain and what changed between pushes. A custom script would have to generate and maintain that itself. ![Stack comment showing a PR's position in the chain](https://docs.mergify.com/stacks/compare/%7BStackComment%7D) \*\*Merge Queue integration.\*\* Stacks are queued as a unit: \[\`@mergifyio queue\`\](/commands/queue) on the top PR enqueues the whole chain bottom-up, and dequeuing a PR also dequeues the PRs above it. See \[Stacked PRs in the Merge Queue\](/merge-queue/stacks). ## Coming From a Custom Script If you already wrap \`git rebase\` and \`gh pr create\`, you don't have to throw anything away. Stacks runs on the same Git primitives, so you can adopt it incrementally: Setup installs the \`commit-msg\` hook that adds Change-Ids, a \`pre-push\` hook that nudges you toward \`mergify stack push\`, and two hooks that keep a Change-Id on commits the first one misses (see \[Setup\](/stacks/setup#4-initialize-your-repository)). From there: - \*\*Existing commits without Change-Ids\*\* get one when you reword them: run \`git rebase -i \`, mark each commit \`reword\`, and the hook fills in the trailer on save. - \*\*Re-runs are safe.\*\* \`mergify stack push\` compares each commit's Change-Id and SHA against GitHub and only touches what changed, so running it twice does no extra work. - \*\*There's an off-ramp.\*\* On GitHub, Stacks creates ordinary branches and PRs, plus the stack and revision-history comments it posts on each PR. None of it is a proprietary format. The only local artifact is the \`Change-Id:\` trailer in your commit messages. Stop using the CLI and your history is still clean, standard Git; the trailer is just an inert line of text. ## Getting Started See the \[setup guide\](/stacks/setup) for the full walkthrough, or \[Creating Stacks\](/stacks/creating) to push your first stack. --- # Unknown \--- title: Mergify Stacks vs gh-stack description: An honest comparison of Mergify Stacks and GitHub's gh-stack CLI for stacked pull requests. --- GitHub released \[gh-stack\](https://github.github.com/gh-stack/), a stacking extension for the \`gh\` CLI. Both tools solve the same problem (big PRs are hard to review, so split them into a chain of small ones), but they take different approaches to get there. ## Two Models for Stacking The biggest difference is how each tool thinks about branches. | | Mergify Stacks | gh-stack | |---|---|---| | \*\*Local model\*\* | One branch, many commits | One branch per PR | | \*\*Identity\*\* | Change-Id trailer in commit message | Branch name | | \*\*Who manages branches\*\* | Mergify auto-creates remote branches | Developer creates and names them | | \*\*Mental model\*\* | "Chain of commits" | "Chain of dependent branches" | Both produce the same result on GitHub: chained PRs where each targets the previous one's branch. The difference is what you deal with locally. ### Mergify Stacks: one branch, many commits \### gh-stack: one branch per PR You create and name a separate branch for each change. Each branch becomes a PR that targets the branch below it: Three branches, three PRs: \`feat/model\` targets \`main\`, \`feat/endpoint\` targets \`feat/model\`, \`feat/tests\` targets \`feat/endpoint\`. You navigate between them with \`gh stack up\` and \`gh stack down\`. ## Feature Comparison | Feature | Mergify Stacks | gh-stack | |---|---|---| | Create a stack | \`mergify stack new \` + commits | \`gh stack init\` + \`gh stack add\` per branch | | Push changes | \`mergify stack push\` | \`gh stack push\` | | Create PRs | Included in \`mergify stack push\` | Separate \`gh stack submit\` command | | View the stack | \`mergify stack list\` | \`gh stack view\` | | Edit mid-stack | \`mergify stack edit \` (targeted pause) | Checkout the branch, edit, rebase | | Reorder changes | \`mergify stack reorder\` or \`mergify stack move\` | Manual rebase + \`gh stack rebase\` | | Squash changes | \`mergify stack squash\` or \`mergify stack fixup\` | Manual | | Cascading rebase | Automatic on push | \`gh stack rebase --upstack\` / \`--downstack\` | | Sync after merge | \`mergify stack sync\` | \`gh stack sync\` | | Open PR in browser | \`mergify stack open\` (interactive picker) | Links from \`gh stack view\` | | Collaboration | \`mergify stack checkout\` | Difficult (force-push based) | | Draft PRs | \`mergify stack push --draft\` | \`gh stack submit --draft\` | | Merge Queue | \[Native Mergify integration\](/merge-queue) | GitHub's built-in merge queue | | Merge a stack | Bottom-up via Merge Queue | \`gh stack merge\` (not yet implemented) | | Stack visualization | Stack comment, browser-extension panel, GitHub's stack map | Native GitHub UI stack map | | Branch naming | Auto-generated (\[configurable\](/stacks/concepts#branch-mapping)) | Developer-chosen or auto-numbered | | Navigate between PRs | N/A (single branch) | \`gh stack up\` / \`down\` / \`top\` / \`bottom\` | | Unstack | Not needed (standard Git branches) | \`gh stack unstack\` | | Atomic push | \`--force-with-lease --atomic\` (all-or-nothing) | \`--force-with-lease --atomic\` (all-or-nothing) | | Conflict memory | Git's native rerere | Built-in automatic rerere | | Pre-operation safety | Git reflog | Automatic branch snapshots before rebases | | Exit codes | \[Structured (8 specific codes)\](/cli/usage#exit-codes) | Structured (8 specific codes) | ## Where Mergify Is Stronger \*\*Simpler workflow.\*\* One branch, standard Git. You don't create branches or navigate between them. You commit and rebase like you already do. The branching complexity lives on the remote side where you don't have to think about it. \*\*One command does more.\*\* \`mergify stack push\` rebases on the target branch, pushes all changes, and creates or updates PRs in a single command. With gh-stack, pushing and creating PRs are separate steps (\`push\` then \`submit\`). \*\*Merge Queue depth.\*\* Mergify's Merge Queue has \[batching\](/merge-queue/batches), \[priority lanes\](/merge-queue/priority), \[speculative checks\](/merge-queue/performance#parallel-checks), and \[queue pause\](/merge-queue/pause). gh-stack relies on GitHub's built-in merge queue, which is more limited. Mergify's Merge Queue also lands \[GitHub-native stacks\](/merge-queue/stacks#github-native-stacked-pull-requests), keeping their members together and in order, so you can use GitHub's stacking UI and Mergify's queue at the same time. \*\*Collaboration support.\*\* \`mergify stack checkout\` lets a teammate pick up your stack locally and push changes. It takes the stack's remote branch name or the URL of any pull request in it. With gh-stack's force-push model, coordinating on the same stack is harder. \*\*Merge works today.\*\* Stacked PRs land through the Merge Queue as each dependency merges. gh-stack's \`merge\` command is listed in the docs but not yet implemented. ## Where gh-stack Is Stronger \*\*Native GitHub UI.\*\* gh-stack gets a stack map rendered directly in the PR interface. Mergify posts a stack comment on each PR and, with the \[browser extension\](/browser-extensions) installed, renders the stack and its revision history as an in-PR panel. Neither of those is a built-in GitHub UI element. \[\`mergify stack push\`\](/stacks/setup#configuration) registers the stack with GitHub's own stacking API by default, so GitHub displays it as a stack. That registration is skipped where the API is not available. ## Other Considerations \*\*Platform lock-in.\*\* gh-stack is GitHub-only by design. Mergify's stacking workflow also targets GitHub today, but the architecture isn't tied to a single platform. \*\*Distribution.\*\* gh-stack ships as a \`gh\` CLI extension and will likely get deeper GitHub integration over time. Mergify CLI is a standalone install via a one-line \`install.sh\` script. \*\*Pricing.\*\* Both are free. Mergify Stacks is a standalone CLI that doesn't require a Mergify subscription. ## Switching from gh-stack If you've been using gh-stack and want to try Mergify Stacks, the migration is straightforward. The main shift is moving from "one branch per PR" to "one commit per PR on a single branch." ### Install and setup This installs the CLI and adds a \`commit-msg\` hook that generates \[Change-Ids\](/stacks/concepts#change-id) for your commits. See the \[setup guide\](/stacks/setup) for details. ### Concept mapping | gh-stack | Mergify Stacks | |---|---| | \`gh stack init\` | \`mergify stack new \` | | \`gh stack add\` (create a branch) | \`git commit\` (create a commit) | | \`gh stack push\` + \`gh stack submit\` | \`mergify stack push\` | | \`gh stack up\` / \`down\` | Not needed (single branch) | | \`gh stack rebase\` | Automatic on \`mergify stack push\` | | \`gh stack sync\` | \`mergify stack sync\` | | \`gh stack view\` | \`mergify stack list\` | ### Workflow before and after \*\*With gh-stack:\*\* \`\`\`bash gh stack init # work on first change gh stack add # work on second change gh stack push gh stack submit \`\`\` \*\*With Mergify Stacks:\*\* \`\`\`bash mergify stack new feat/my-feature git commit -m "first change" git commit -m "second change" mergify stack push \`\`\` The result on GitHub is the same: two chained PRs, each showing one change. ---