# if Conditions

say it: **“if kun-DISH-unz”** **/ɪf kənˈdɪʃənz/**

Runs a job or step only when a condition holds.

## What does `if Conditions` do?

`if:` runs a job or step only when a condition is true, like only on the main branch.

```yaml
if: github.ref == 'refs/heads/main'
```

Level: Journeyman · [More GitHub Actions terms at this level](https://www.ask-codey.com/glossary?category=github-actions&level=3)

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/if-conditions
