CI/CD gates: checks before the merge and checks after the deploy
A change goes through two different kinds of gate on its way to production. They answer different questions, and teams often rely on the first and forget the second.
Gate 1, before the merge: should this change go in?
These run on the proposed change and GitHub enforces them if you mark them required. They are good at catching mistakes that tests can find.
- Pull request checks: build, tests, lint, security scans.
- Reviews: approvals, code owners.
- Branch rules: up to date, conversations resolved, signed commits.
Gate 2, after the deploy: did it work in production?
These run on the real system. They catch what tests cannot, such as a missing environment variable, a failed migration on real data or a service that starts and then crashes.
- The deploy workflow: does it finish, and does every step succeed?
- A health check: does the live service answer correctly a few minutes later?
- Alerts and monitoring that watch real traffic.
Why you need both
- Green checks do not prove the deploy will work. The environments differ.
- A good deploy does not prove the change passed its tests, if checks were optional or missing.
- When gate 2 fails, the fastest fix is usually to revert the merge and look into it later.
Where scheduled merges fit
A scheduled merge adds timing: it decides when the change goes through gate 1 and into gate 2. The risk is that nobody is watching gate 2 at that time. That is why the watch and the revert matter more for out-of-hours releases than for daytime ones.
How Merge Scheduler covers both
- Before the merge it re-reads the checks, reviews and branch state for the pinned commit, waits for checks that are still running, and skips the merge when something is failing or blocked.
- After the merge it watches your GitHub Actions deploy, or in health-only mode your health URL. If the release fails and auto-revert is on, it opens and merges a revert pull request and emails you.
- It does not run tests and it does not replace branch protection. It reads what GitHub reports and acts on it.
Do this in Merge Scheduler: Set up automatic revert for a failed deploy · Add a health check URL to catch bad releases that deploy green
Related: How to automatically revert a failed deploy (and when not to) · GitHub checks explained: check runs, commit statuses and required checks · Releasing outside business hours: a checklist for small teams