Merge multiple merge requests into a single branch in GitLab using tags.
- Start the application
- Configure a webhook to send a request when receiving a comment in a merge request (MR) in GitLab
URL looks like: http://your-server.tld:8080/webhook - The application receives the request
- The application retrieves all MRs with a unique tag
- Clone the repository
- Merge all MRs into one branch
- Push the changes into branch
You can install this in docker:
docker run -d --rm --name gitlab-mr-combiner \
-p 8080:8080 \
-e TRIGGER_MESSAGE="/specific-message" \
-e TARGET_BRANCH="target_branch" \
-e TRIGGER_TAG="specific_tag" \
-e GITLAB_TOKEN="<your access_token>" \
-e SECRET_TOKEN="<your secret_token, optional>" \
-e GITLAB_URL="<your_gitlab_url>, default is https://gitlab.com" \
-v ~/.ssh:/root/.ssh:ro \
globalartltd/gitlab-mr-combiner
You can install using helm chart
You must store the SSH private key of any user who has access to the repository!
In this example, we mount it from the volume.
- Create a webhook for the group or repository, selecting the trigger: Comments.
- In the project settings, create a specific tag from your Docker environment, for example:
stage-mr
. - Apply this tag to all merge requests (MRs) that you want to merge.
- Send
/specific-message
from the Docker environment.