Severity: Warning | Category: Comparison
Detects keys present in a reference file (e.g., .env.example) but missing in the target file.
DATABASE_URL=postgres://localhost
API_KEY=your-key-here
REDIS_URL=redis://localhost
DATABASE_URL=postgres://prod-server
$ envcheck compare .env.example .env.prod
.env.prod: W004: Missing key: API_KEY
.env.prod: W004: Missing key: REDIS_URL
#!/bin/bash
if ! envcheck compare .env.example .env.prod --quiet; then
echo "ERROR: Production environment is missing required keys!"
exit 1
fi
- name: Validate environments
run: |
envcheck compare .env.example .env.staging --format=github
envcheck compare .env.example .env.prod --format=github
# .envcheckrc.yaml
rules:
W004:
severity: warning
ignore_keys:
- OPTIONAL_FEATURE_* # Don't warn about missing optional keys