Use debian-salsa example
---
workflow:
rules:
- - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
+ # If the branch matches the ones it should not run on, ignore it.
+ - if: $CI_IGNORED_BRANCHES && $CI_COMMIT_REF_NAME =~ $CI_IGNORED_BRANCHES
when: never
- # - if: $CI_COMMIT_BRANCH == "main"
- # - if: $CI_COMMIT_BRANCH =~ "^dev_.*"
- - if: $CI_COMMIT_BRANCH
+ # Avoid duplicated pipelines, do not run detached pipelines.
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ when: never
+ # Otherwise, if there's a debian/ folder, run.
+ - exists:
+ - debian/**
+ when: always
+ # Fallback to not running.
+ - when: never
stages:
- build
