gitlab ci trigger pipeline after updating labels in merge request

Viewed 357

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."
0 Answers
Related