Skip to content
Latchkey

if Conditional (GitHub Actions) - CI/CD Glossary Definition

The if: conditional decides whether a job or step runs, based on an expression.

The if conditional is a if: expression on a job or step that decides whether it runs, evaluated against contexts such as github, needs, and step outcomes.

An if: expression gates execution. It commonly checks the event, branch, or the result of prior steps, for example running a deploy step only on the main branch.

Example

.github/workflows/ci.yml
if: github.ref == 'refs/heads/main' && success()

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →