View as Markdown

Scheduling Freezes

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.

Use a freeze for a release you are stabilizing, a high-traffic event, an audit window, or an incident.

Without the 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), as are drafts, closed pull requests, and conflicting ones unless a queue rule can merge them anyway.

freeze starts freeze ends Freeze on base = main #41 #42, labeled hotfix active active held held can merge can merge can merge can merge freeze starts freeze ends Freeze on base = main #41 #42, labeled hotfix active active held held can merge can merge can merge can merge
A pull request the freeze matches is held until the freeze ends. One that matches its exclude conditions, here the hotfix label, merges during the freeze.

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, not the tests:

Tests freeze PR1 PR1: tested during the freeze, and passes. It is not tested again. passes PR1 + PR2 PR1 + PR2: tested during the freeze, and passes. It is not tested again. passes Pull requests PR1 PR1 passed during the freeze, waits for it to end, then merges. PR1 passed during the freeze, waits for it to end, then merges. merged PR2 PR2 passed during the freeze, waits for it to end, then merges after PR1. PR2 passed during the freeze, waits for it to end, then merges after PR1. merged Tests freeze PR1 PR1: tested during the freeze, and passes. It is not tested again. passes PR1 + PR2 PR1 + PR2: tested during the freeze, and passes. It is not tested again. passes Pull requests PR1 PR1 passed during the freeze, waits for it to end, then merges. PR1 passed during the freeze, waits for it to end, then merges. merged PR2 PR2 passed during the freeze, waits for it to end, then merges after PR1. PR2 passed during the freeze, waits for it to end, then merges after PR1. merged
With the merge queue, a freeze holds back the merge, not the tests: queued pull requests are tested during the freeze, and those that passed merge once it ends, in queue order, without being tested again. Not to scale.
Scheduled Freezes Scheduled Freezes

In the dashboard under Merge Protections → Scheduled Freezes, click Schedule a Freeze, then:

  1. Give the freeze a reason. It is required, and it names the freeze wherever Mergify reports it

  2. Under Schedule, set Starts, Ends and the Timezone they are read in. Leave Ends empty for a freeze that lasts until you remove it

  3. Under Scope, add the conditions a pull request must match to be blocked, or leave it empty to freeze every pull request on the repository. Under Exceptions, add the conditions that let a pull request through anyway

  4. Click Save Freeze; the freeze appears under Upcoming until it starts

New Scheduled Freeze New Scheduled Freeze

Freeze Now opens the same editor without a start date: pull requests matching Scope are blocked the moment you save.

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 with a schedule condition instead:

.mergify.ymlyaml
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 for the accepted formats.

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 them 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 below).

The freeze CLI reference lists every command, flag and option.

Terminal windowbash
mergify freeze list

Create a time-bounded freeze:

Terminal windowbash
mergify freeze create \
--reason "Release stabilization" \
--timezone UTC \
--start 2030-01-15T18:00:00 \
--end 2030-01-15T22:00:00

--start and --end are read in the timezone you pass with --timezone, and Mergify rejects a freeze that starts or ends in the past. Omit both for an emergency freeze that starts now and lasts until you delete it.

Restrict which pull requests are affected with matching conditions (-c) and let specific ones through with exclude conditions (-e):

Terminal windowbash
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.

Modify an existing freeze by its ID:

Terminal windowbash
mergify freeze update <freeze_id> \
--end 2030-01-16T06:00:00

Remove a freeze by its ID:

Terminal windowbash
mergify freeze delete <freeze_id>

Was this page helpful?