3

If I created the MR with the bug label, it will trigger the label script;

If I created the MR without the label, it will not trigger; even if I add the label later on the MR view, the CI will not trigger the script as well. Is it possible to do so?

My .gitlab-ci.yml is

stages:
    - build

workflow:
    rules:
        - if: $CI_MERGE_REQUEST_IID

build:
    stage: build
    rules:
        - if: '$CI_MERGE_REQUEST_LABELS =~ /bug/'
          when: always
        - when: never
    script:
        - echo $CI_MERGE_REQUEST_LABELS
        - echo "The bug label is defined."
user3906723
  • 117
  • 2
  • 15
  • Aren't those when condition redundants? The web editor tells you the file is valid? – Moia Jun 14 '22 at 16:02

0 Answers0