You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnil, errors.Wrapf(err, "Failed get production branch on %s/%s to update cobradocs on Pull Request %d", website.Owner, website.Name, pr.GetNumber())
returnnil, errors.Wrapf(err, "Failed to run cobradoc sync script in repository %s/%s to %s on Pull Request %d", website.Owner, website.Name, newBranch, prInfo.num)
60
-
}
61
-
62
-
// Amend the commit to change the author to the bot.
63
-
iferr:=website.Commit(ctx, "", git.CommitOpts{
64
-
Author: botCommitAuthor,
65
-
Amend: true,
66
-
NoEdit: true,
67
-
}); err!=nil {
68
-
returnnil, errors.Wrapf(err, "Failed to amend commit author to %s on Pull Request %d", op, prInfo.num)
69
-
}
70
-
71
-
// Push the branch
72
-
iferr:=website.Push(ctx, git.PushOpts{
73
-
Remote: "origin",
74
-
Refs: []string{newBranch},
75
-
Force: true,
76
-
}); err!=nil {
77
-
returnnil, errors.Wrapf(err, "Failed to push %s to %s on Pull Request %d", newBranch, op, prInfo.num)
78
-
}
79
-
80
-
// Create a Pull Request for the new branch
81
-
newPR:=&github.NewPullRequest{
82
-
Title: github.String(fmt.Sprintf("[cobradocs] synchronize with %s (vitess#%d)", pr.GetTitle(), pr.GetNumber())),
83
-
Head: github.String(newBranch),
84
-
Base: github.String(branch),
85
-
Body: github.String(fmt.Sprintf("## Description\nThis is an automated PR to synchronize the cobradocs with %s", pr.GetHTMLURL())),
returnnil, errors.Wrapf(err, "Failed to run cobradoc sync script in repository %s/%s to %s on Pull Request %d", website.Owner, website.Name, op, prInfo.num)
98
+
}
99
+
100
+
// Create a tree of the commit above using the GitHub API and then commit it.
101
+
_, commit, err:=h.writeAndCommitTree(
102
+
ctx,
103
+
client,
104
+
website,
105
+
pr,
106
+
branch,
107
+
"HEAD",
108
+
baseTree,
109
+
parent,
110
+
fmt.Sprintf("synchronize cobradocs with %s/%s#%d", vitess.Owner, vitess.Name, pr.GetNumber()),
111
+
op,
112
+
)
89
113
iferr!=nil {
90
-
returnnil, errors.Wrapf(err, "Failed to create Pull Request using branch %s on %s/%s", newBranch, website.Owner, website.Name)
0 commit comments