[go: up one dir, main page]

Skip to content

Push Options: Provide a way to create 2 merge requests to different branches.

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

I suggest to improve GitLab Push Options feature.

Here's what I was trying to do in my Makefile:

publish!:
	git push --force origin $(BRANCH) \
		-o merge_request.create \
		-o merge_request.target=master \
		-o merge_request.assign="$(USERNAME)" \
		-o merge_request.label="to-production" \
		-o merge_request.title="$(TICKET) $(FEATURE_NAME)"
	git commit --allow-empty -m "empty commit"
	git push --force origin $(BRANCH) \
		-o merge_request.create \
		-o merge_request.target=staging \
		-o merge_request.assign="$(USERNAME)" \
		-o merge_request.label="to-staging" \
		-o merge_request.title="[staging] $(TICKET) $(FEATURE_NAME)"

Unfortunately even with --force and and empty commit it doesn't create second merge request, but instead shows me the link to the first one created.

The reason for 2 MR creation is our flow - the staging one gets merged almost instantly after brief review. The production one will be around for a bit longer.

Upd: just realized that the above setup changes target branch instead of creating new MR:

image

Edited by 🤖 GitLab Bot 🤖