This commit is contained in:
Adam Majer 2024-07-10 00:04:54 +02:00
parent ca6eb9e57e
commit ee80b15d17

View File

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