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
Expression Syntax (GitHub Actions) - CI/CD Glossary DefinitionExpression Syntax (GitHub Actions): Expression syntax is the `${{ }}` language in GitHub Actions used to read…
Context (GitHub Actions) - CI/CD Glossary DefinitionContext (GitHub Actions): A context is a named object of run data available in expressions, such as `github`,…