/merge quick action does not auto-append SHA when used outside main MR thread
Summary
The /merge quick action fails to automatically append the SHA of the head of the branch when used outside the main MR thread (e.g., in review comments, batch review submissions, or combined with other quick actions). This causes the merge to fail with "Branch cannot be merged" or silently not set auto-merge.
Root Cause
When /merge is used in the main MR thread, GitLab automatically appends the current HEAD SHA. However, when used in other contexts (review comments, batch reviews, or combined quick actions), this automatic appending of merge_request_diff_head_sha is not happening
Affected Scenarios
-
Review comments: Using
/mergeas part of a review submission -
Combined quick actions: Using
/mergewith/run_pipelineor/approvein the same comment -
Batch reviews: Submitting
/mergeas part of finishing a review
Steps to reproduce
- Open a merge request that is ready to merge
- On a diff thread:
/approve /run_pipeline /merge - Add the comment, and check the auto merge is set
Edited by 🤖 GitLab Bot 🤖