.
This commit is contained in:
@@ -91,7 +91,7 @@ func (h *RequestHandler) CreateRepositoryIfNotExist(org Organization, repoName s
|
||||
return repo.Payload
|
||||
}
|
||||
|
||||
func (h *RequestHandler) CreatePullRequest(repo *models.Repository, srcId, targetId string) *models.PullRequest {
|
||||
func (h *RequestHandler) CreatePullRequest(repo *models.Repository, srcId, targetId, title, body string) *models.PullRequest {
|
||||
if h.HasError() {
|
||||
return nil
|
||||
}
|
||||
@@ -99,9 +99,12 @@ func (h *RequestHandler) CreatePullRequest(repo *models.Repository, srcId, targe
|
||||
transport := h.allocateGiteaTransport()
|
||||
client := apiclient.New(transport, nil)
|
||||
|
||||
var prOptions models.CreatePullRequestOption
|
||||
prOptions.Base = repo.DefaultBranch
|
||||
prOptions.Head = srcId
|
||||
prOptions := models.CreatePullRequestOption{
|
||||
Base: repo.DefaultBranch,
|
||||
Head: srcId,
|
||||
Title: title,
|
||||
Body: body,
|
||||
}
|
||||
|
||||
pr, err := client.Repository.RepoCreatePullRequest(
|
||||
repository.
|
||||
@@ -136,8 +139,9 @@ func (h *RequestHandler) RequestReviews(pr *models.PullRequest, reviewer string)
|
||||
transport := h.allocateGiteaTransport()
|
||||
client := apiclient.New(transport, nil)
|
||||
|
||||
var reviewOptions models.PullReviewRequestOptions
|
||||
reviewOptions.Reviewers = []string{reviewer}
|
||||
reviewOptions := models.PullReviewRequestOptions{
|
||||
Reviewers: []string{reviewer},
|
||||
}
|
||||
|
||||
review, err := client.Repository.RepoCreatePullReviewRequests(
|
||||
repository.
|
||||
|
||||
Reference in New Issue
Block a user