.
This commit is contained in:
parent
ca6eb9e57e
commit
ee80b15d17
@ -24,13 +24,13 @@ func processPullRequestCreated(h *common.RequestHandler) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create PrjGit branch for buidling the pull request
|
// 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
|
commitMsg := fmt.Sprintf(`auto-created for %s
|
||||||
|
|
||||||
This commit was autocreated by %s
|
This commit was autocreated by %s
|
||||||
referencing
|
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)
|
prjGit := h.CreateRepositoryIfNotExist(*req.Repository.Owner, common.DefaultGitPrj)
|
||||||
if h.HasError() {
|
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("", "clone", "--depth", "1", prjGit.SSHURL, common.DefaultGitPrj)
|
||||||
h.GitExec("", "checkout", "-B", branchName, prjGit.DefaultBranch)
|
h.GitExec("", "checkout", "-B", branchName, prjGit.DefaultBranch)
|
||||||
h.GitExec(common.DefaultGitPrj, "submodule", "update", "--checkout", "--depth", "1", req.Repository.Name)
|
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), "fetch", "--depth", "1", req.Pull_Request.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), "checkout", req.Pull_Request.Head.Sha)
|
||||||
h.GitExec(common.DefaultGitPrj, "commit", "-a", "-m", commitMsg)
|
h.GitExec(common.DefaultGitPrj, "commit", "-a", "-m", commitMsg)
|
||||||
h.GitExec(common.DefaultGitPrj, "push", branchName)
|
h.GitExec(common.DefaultGitPrj, "push", branchName)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user