Recently I am blocked on the following problem. Given the source branch of an MR, the target branch - master, and the setting to put on hold the merge until all pipelines succeed - the merge goes in straight away, while the pipeline is still running. I’m not sure if the merge takes place before the pipeline’s been triggered or after but in one case it’s violating the ‘On pipeline success’ project setting, in the other case - it’s just running at the inappropriate time.
The triggers I’m using are (under each job):
- if: “$CI_MERGE_REQUEST_IID”
- if: “$CI_COMMIT_BRANCH == ‘master’”
How can I make it so that when I click the merge button a pipeline to be triggered which to check if the merge can happen, halting the merge self until it passes?
I read about merge results. It seems a lot like it but I’m using the free on-premise version of Gitlab, which doesn’t support it.