GitLab CI/CD 1 · When jobs run

Run only on the default branch

Use rules to control when a job is added to the pipeline.

deploy-job:
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

Official GitLab CI/CD 1 documentation

More when jobs run commands

All when jobs run commands · GitLab CI/CD 1 cheatsheet

Was this page helpful?