This commit is contained in:
2024-07-10 11:41:34 +02:00
parent 262cc0ff91
commit fe58462b59
2 changed files with 19 additions and 8 deletions

View File

@@ -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.