Forked from joshjohanning/gitlab-create-merge-request.sh
Created
September 18, 2024 13:22
-
-
Save kachsheev/01403c5761b8cb95c109013da889b79c to your computer and use it in GitHub Desktop.
create gitlab merge requests via the api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GITLAB_URL="https://example.gitlab.com/" | |
PROJECT_ID="2" # get this id via the repo/project's overview page | |
ACCESS_TOKEN="glpat-abc" | |
# Create a new merge request | |
curl --header "Private-Token: $ACCESS_TOKEN" \ | |
"$GITLAB_URL/api/v4/projects/$PROJECT_ID/merge_requests" \ | |
--data "source_branch=my-branch" \ | |
--data "target_branch=main" \ | |
--data "title=My new merge request" #--data "description=this is a description" | |
# description will be `null` - which is what I was testing | |
# see also: https://docs.gitlab.com/ee/api/merge_requests.html#create-mr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment