2

I am facing an issue in GitLab that is when I use reg tag it executes my regression test suite. But when I give any other tag value it runs pipeline without any error. Please tell me how to add the condition in which only reg tag should work or else job should be failed.

Please find the logs : https://paste.gg/p/anonymous/35037480fd2440b5898a76ed81f945d5

image: maven:3.3.9-jdk-8

cache: paths: - .m2/repository

stages:

  • test

cucumber_test: stage: test tags: [regression , sanity] rules:

  • if: '$Tag == "REG1"' allow_failure: true
  • when: on_success script:
    • mvn "clean" "test" "-Dcucumber.filter.tags=@%Tag%" allow_failure: false artifacts: when: always paths:
      • Report

1 Answers1

0

you can try this rules:

  • if: $Tag != "REG" when:never

Since your condition is not saying the pipeline to exit when there's not a REG tag yet