I have a use case where I need to disable the Merge button for all merge requests if a pipeline is running on the target( usually master) branch.
There isn't really any way to disable to the button itself, but you can ensure that master
is a protected branch (which it should be by default) and then changing or ensuring that the permissions to merge is limited to certain users or roles.
In the case where you want to prevent multiple merges to the same branch that may conflict, then consider merge trains where a merge will take into account changes from any other merges to the same branch. This is a paid feature for any private projects, but is free for public projects on GitLab.com. On a self-managed instance though it's paid only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With