Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an AND option on the rules condition in .gitlab-ci.yml?

I want to create some nested conditions: i need this pipeline to work when it is a merge or merge request and with certain name start "feature". So, is there an AND condition in the 'only' option for jobs?

like image 930
Claudio Torres Avatar asked Jan 24 '23 09:01

Claudio Torres


1 Answers

No there is not. You must use rules.

test:
  stage: test
  script:
    - echo "test"
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^feature/'
like image 143
danielnelz Avatar answered Feb 24 '23 17:02

danielnelz