pipelines for merged results
3 thoughts on “pipelines for merged results”
  1. I was checking the value of different variables in different steps, and I got this rule to get the event of the "Merge" of a merge request:

    – if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "<YOUR_BRANCH>" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'

    I'm working in a different branch (not main) so the conditions are weird for me, but it works.

    In that case <YOUR_BRANCH> is the target branch you're merging to (in my case is different from main)
    I don't know why in that event the "target" branch is main but that's the value of the variable when I hit "Merge" in the Merge request.

  2. There's some confusion regarding the term merged results pipeline. The merged result isn't a pipeline that happens AFTER the merge request is accepted and merged. What this feature actually does is run a pipeline that includes a merge of your feature and your target branch (e.g. feature-123 & develop). So this does adhere to the text on the description, "Merge pipelines will try to validate the post-merge results PRIOR to merging".

    To see this pipeline in action, you can branch off develop, make a change to that branch. Then create a merge request back to develop. This should kick off another pipeline attempting to validate your pipeline on a merged version of your branch and develop.

  3. So. Seriously, did you figure this out? I've spent days trying to understand how to run CI only when merging. Not when pushing to a MR. But, only when I manually merge the MR.

Leave a Reply

Your email address will not be published.

Captcha loading...