Search code examples
logicgitlab-cigitlab-ci-runner

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?


Solution

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