Skip to content
Latchkey

What Is a .env file?

a .env file explained, including what it does and how it matters in CI/CD.

A .env file stores key=value environment variables loaded by tools like dotenv.

What it is

It is convenient for local development but should never be committed with real secrets, since that leaks credentials into version control.

Why it matters in CI/CD

In CI, do not commit .env with secrets; inject values from the platform secret store (GitHub Actions secrets) at runtime instead.

Key takeaways

  • .env holds local env vars.
  • Never commit real secrets.
  • In CI, inject secrets from the platform.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →