Skip to content
Latchkey

What Is a Scoped Variable?

A scoped variable is a pipeline variable bound to a specific environment or matching condition, so it is exposed only to jobs that fall within that scope. The same variable name can carry different values per environment. It lets one pipeline definition target many environments without leaking the wrong value.

Why it matters

A deploy pipeline often needs distinct credentials or endpoints per environment, such as staging versus production. Scoping a variable to an environment ensures a staging job cannot accidentally receive production secrets. It keeps a single pipeline safe to reuse across many targets.

Related guides

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