Skip to content

Be Able to Add Custom Logic on GitLab Merge Request after Clicking the "Merge" Button

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

It would be nice to be able to add custom logic on GitLab Merge Requests to apply additional validation logic and potentially abort the merge if needed. This would be ideal for customer using something like semantic-release:

https://github.com/semantic-release/semantic-release https://github.com/semantic-release/commit-analyzer

Proposal

1. GitLab -> "Merge..." button is clicked on MR form

2. git server pre-receive hook is triggered with final push (merge commit) and a final commit message

3. Use the logic in the event that comes from clicking the "Merge" button, and apply validation logic and abort merge if needed with showing error message in GitLab UI: https://docs.gitlab.com/ee/administration/server_hooks.html#custom-error-messages

Note that this might also be achieved by this Ultimate feature:

https://docs.gitlab.com/ee/user/project/merge_requests/status_checks.html#block-merges-of-merge-requests-unless-all-status-checks-have-passed

But That would require External Status Checks to be moved to the Premium pricing model and would not be ideal for Premium users.

Edited by 🤖 GitLab Bot 🤖