I made a pipeline with one stage - compile & test which has one job that runs go test
and has a trigger:
rules:
- if: '$CI_MERGE_REQUEST_ID'
Before having that rule in the end, Gitlab would run 2 pipelines for me - 1 detached and 1 against the target branch (into which we're aiming to merge). After introducing the above rule Gitlab got rid of attempting to run a second pipeline against the merge target branch and runs only a pipeline in detached mode.
My end goal is to have a trigger implemented with rules such that gets triggered:
- When commits are being pushed to the MR
- When I'm about to merge
- When for some time no updates on the MR branch have occurred, it runs the stage against the target branch. Essentially, the so-called merge results pipeline.
Hence, how can I achieve all from 1. to 3. using rules
?