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

Viewed 12670

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?

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/'
Related