Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

A missing line in .env.example took down our prod, so I built a PR check for it

Description and use

A missing line in .env.example caused a production outage, so the author built deployhealth, a tool that automatically scans env var usage, compares against .env.example, and reports missing vars via PR checks, CLI scans, and uptime monitoring.

Problem

A missing environment variable caused a production outage after a deploy, and existing safety nets failed to catch it.

Outcome

Deployhealth prevents missing env var outages by automating detection and reporting, reducing manual debugging time from hours to seconds.

Workflow

  • Scan repository for env var usage in code
  • Compare found vars against .env.example and .env files
  • In PRs, comment on new env var usage and missing declarations
  • Flag committed .env files with potential leaked keys
  • Run CLI scan on every push to report unused or missing vars
  • Monitor uptime to detect failures linked to recent deploys and report introduced missing vars

Evidence

The cause was an env var. The change read a new variable that existed on the developer's machine but had never been added to .env.example or to production.

Source

Validate env vars at startup. t3-env, envalid or a small zod schema make the app fail on boot with a clear message, instead of on the first request with a mystery 500.

Source

It started as envcheck, a small scanner that finds every env var your code reads and compares them with your env files. Pull request checks and uptime monitoring grew around it, and it became deployhealth.

Source

Acme API started failing 4m after deploy b52952e, which introduced 2 missing env vars: REDIS_URL, STRIPE_KEY

Source

  • Record date: 2026-10-06T16:41:00.374Z