From ee80b15d17385a8030e8b0b734e46e4ffec6e2bfc7beec4db1a63b2144db90cd Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 10 Jul 2024 00:04:54 +0200 Subject: [PATCH] . --- pr-review/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pr-review/main.go b/pr-review/main.go index 07ba2fd..ceddeb5 100644 --- a/pr-review/main.go +++ b/pr-review/main.go @@ -24,13 +24,13 @@ func processPullRequestCreated(h *common.RequestHandler) error { } // create PrjGit branch for buidling the pull request - branchName := fmt.Sprintf("PR_%s#%d", req.PullRequest.Repository.Name, req.PullRequest.Number) + branchName := fmt.Sprintf("PR_%s#%d", req.Pull_Request.Repository.Name, req.Pull_Request.Number) commitMsg := fmt.Sprintf(`auto-created for %s This commit was autocreated by %s referencing -PullRequest: %s#%d`, req.PullRequest.Repository.Name, GitAuthor, req.PullRequest.Repository.Name, req.PullRequest.Number) +PullRequest: %s#%d`, req.Pull_Request.Repository.Name, GitAuthor, req.Pull_Request.Repository.Name, req.Pull_Request.Number) prjGit := h.CreateRepositoryIfNotExist(*req.Repository.Owner, common.DefaultGitPrj) if h.HasError() { @@ -40,8 +40,8 @@ PullRequest: %s#%d`, req.PullRequest.Repository.Name, GitAuthor, req.PullRequest h.GitExec("", "clone", "--depth", "1", prjGit.SSHURL, common.DefaultGitPrj) h.GitExec("", "checkout", "-B", branchName, prjGit.DefaultBranch) h.GitExec(common.DefaultGitPrj, "submodule", "update", "--checkout", "--depth", "1", req.Repository.Name) - h.GitExec(path.Join(common.DefaultGitPrj, req.Repository.Name), "fetch", "--depth", "1", req.PullRequest.Head.Sha) - h.GitExec(path.Join(common.DefaultGitPrj, req.Repository.Name), "checkout", req.PullRequest.Head.Sha) + h.GitExec(path.Join(common.DefaultGitPrj, req.Repository.Name), "fetch", "--depth", "1", req.Pull_Request.Head.Sha) + h.GitExec(path.Join(common.DefaultGitPrj, req.Repository.Name), "checkout", req.Pull_Request.Head.Sha) h.GitExec(common.DefaultGitPrj, "commit", "-a", "-m", commitMsg) h.GitExec(common.DefaultGitPrj, "push", branchName)