I believe it's stupid question but I don't understand how should I use gitlab merge request push options
I have this scenario:
- I have open merge request from develop to master
- I make some changes on develop branch and push them to gitlab server with the proper option
git add .
git commit -m 'finish mr'
git push origin develop -o merge_request.merge_when_pipeline_succeeds
- I expect that after pipelines of this commit will succeed the MR be merged but instead I get this message on gitlab MR page:
@user aborted the automatic merge because source branch was updated just now
@user added 1 commit just now
8efdbde1 - finish mr
So it seems that the push will set MR to allow merge after succeed and immediately abort it because of commit from same push. I also tried quick actions with /merge but same result. I know there is gitlab API, but I can't use it. Does anyone know what I am doing wrong?
EDIT:
as accepted answer suggested adding target branch helped, but I also needed to add ci.skip:
git push origin $CI_COMMIT_REF_NAME \
-o ci.skip \
-o merge_request.target="$MASTER_BRANCH_NAME" \
-o merge_request.merge_when_pipeline_succeeds \
-o merge_request.create