Feat: Allow Creation of MRs for Forked Target (#303)
feat: Adds MR creation for project forks
This commit is contained in:
committed by
GitHub
parent
816b87cf91
commit
53d5647380
@@ -11,11 +11,12 @@ import (
|
||||
)
|
||||
|
||||
type CreateMrRequest struct {
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
TargetBranch string `json:"target_branch"`
|
||||
DeleteBranch bool `json:"delete_branch"`
|
||||
Squash bool `json:"squash"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
TargetBranch string `json:"target_branch"`
|
||||
DeleteBranch bool `json:"delete_branch"`
|
||||
Squash bool `json:"squash"`
|
||||
TargetProjectID int `json:"forked_project_id,omitempty"`
|
||||
}
|
||||
|
||||
/* createMr creates a merge request */
|
||||
@@ -59,6 +60,10 @@ func (a *api) createMr(w http.ResponseWriter, r *http.Request) {
|
||||
Squash: &createMrRequest.Squash,
|
||||
}
|
||||
|
||||
if createMrRequest.TargetProjectID != 0 {
|
||||
opts.TargetProjectID = gitlab.Ptr(createMrRequest.TargetProjectID)
|
||||
}
|
||||
|
||||
_, res, err := a.client.CreateMergeRequest(a.projectInfo.ProjectId, &opts)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user