Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab CI: MERGE_REQUEST_EVENT not triggered by update?

I'm testing GitLab CI pipelines.

I have created a merge request named "TEST" that have its gitlab-ci.yml with a rule like below:

if '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE == "TEST"'

It worked fine as I expected. Create event triggered the merge_request_event.
However, if I create a merge request have another title and then I update it to "TEST", It doesn't seems to trigger the merge_request_event.

According to this document, merge_request_event is supposed to be triggered by updated too.

For pipelines created when a merge request is created or updated. Required to enable merge request pipelines, merged results pipelines, and merge trains.

Do I take it wrong or missed important information or documents?

like image 816
Akumachan Avatar asked Sep 15 '25 13:09

Akumachan


1 Answers

The documentation is correct, but perhaps the meaning is not 100% clear.

For pipelines created when a merge request is created or updated.

Stated more precisely:

When an MR action creates a pipeline, $CI_PIPELINE_SOURCE will be equal to merge_request_event

However, it does not mean to imply that any update will create a pipeline. Updating the MR title does not create a pipeline, so this is not applicable to that scenario.

However, after you have changed the title, if some other event creates a new pipeline (specifically: push events to the MR source branch or manually running a new pipeline on the MR), the rule will evaluate to true and the job will be included in the created pipeline.

Per the docs:

Merge request pipelines:

  • Run when you:
    • Create a new merge request.
    • Push a new commit to the source branch for a merge request.
    • Select Run pipeline from the Pipelines tab in a merge request.
like image 121
sytech Avatar answered Sep 17 '25 20:09

sytech



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!