← Back to all fixes
Pipeline fails: environment variable not set
The Issue
`CI: Required env var STRIPE_KEY not set` — build fails but works locally.
Root Cause
The variable is in your local `.env` file (not committed) but not added to the CI platform secrets.
How to Fix
Add the secret to your CI platform: GitHub Actions Secrets, GitLab CI Variables, or Jenkins CredentialsReference it in the pipeline YAML: `env: STRIPE_KEY: ${{ secrets.STRIPE_KEY }}`Add a validation step at the top of your pipeline: fail fast if required vars are missingNever commit .env files — use .env.example to document required variables