Every push leaves main green
Green main isn't a policy for the CI team to enforce — it's a shared team responsibility. Here's why the rule is worth defending, and how I hold teams to it without turning into the CI police.

Green main is the cheapest superpower a team can give itself. Deploy at any time. Cut a release from any commit. Onboard a new hire and let them push on day one without a five-page checklist. All of it depends on one thing: the last commit on main works.
So the rule I enforce, non-negotiably, is every push leaves main green. Not "green in an hour after the pipeline settles." Not "green after someone else fixes it." Green when you walk away from your machine.
Why teams break this rule
Usually it's not carelessness. It's one of three failures:
The pipeline is too slow. If CI takes 20 minutes, developers merge and go to lunch. If it fails while they're eating, main is red for an hour before anyone notices. Fix the pipeline — split it, cache it, parallelise it — before you fix the humans.
Merging without waiting. Someone hits "Squash and merge" while CI is still running. This is a policy failure, not a person failure. Turn on required status checks. Make it impossible.
Flaky tests treated as noise. The moment "retry the flaky test" becomes acceptable, main will eventually break for real and nobody will notice because everyone's tired of alerts. Quarantine flaky tests within one day, delete or fix within one week.
What "green" actually means
Not just "unit tests pass." Green means:
Build succeeds.
Types check.
Lint passes at the level the team agreed on.
Unit and integration tests pass.
The deployed preview environment loads without a 500.
If any of these is optional, define why in the repo README. Otherwise it's not a standard, it's a suggestion.

When main goes red anyway
Because it will. The rule for me is:
Whoever pushed the change owns the fix. Not later. Now.
Concretely: revert first, debug second. The wrong reflex is "I'll fix it in 10 minutes." Every minute main is red, every teammate pulling latest inherits your problem. Revert takes 30 seconds and buys everyone else their afternoon back. Then investigate on your branch, at your pace, with the whole test log in front of you.
If the fix is truly trivial and you can prove it in under two minutes, fine — but the burden of proof is on the fixer, not on the team waiting to merge.

Blameless doesn't mean consequence-less
I don't call out people who broke main. But I do make it visible. Weekly team review, one slide: how many red incidents on main this week, average time to green. Not to shame — to normalise attention. Teams that stop measuring drift back into "eh, it's fine" within a month.
The payoff
When main is always green, four things happen that you don't get otherwise:
Any commit can ship. That unlocks continuous delivery, feature flags, gradual rollouts.
Reviewers focus on the change, not on "is this build even broken?"
New hires can push code on day one without a chaperone.
You stop scheduling "stabilization sprints" — because there's nothing to stabilise.
Every push leaves main green. It's the cheapest rule to state, the hardest to hold, and the most compounding investment a team makes.
More Articles
Continue reading with these related posts



