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
["git",["checkout",process.env.TARGET_BRANCH]],// checkout the target branch
53
+
["git",["checkout","-b",branchName]],// create a new branch
54
+
["git",["cherry-pick",squashSha.trim()]],//
55
+
["git",["remote","add","fork",remoteUrl]],// Add the remote fork
56
+
["git",["push","--set-upstream","fork",branchName,"-f"]]// push the branch
57
+
]);
58
+
59
+
constgh=newOctokit();
60
+
gh.authenticate({
61
+
type: "token",
62
+
token: process.argv[2]
63
+
});
64
+
constr=awaitgh.pulls.create({
65
+
owner: "Microsoft",
66
+
repo: "TypeScript",
67
+
maintainer_can_modify: true,
68
+
title: `🤖 Cherry-pick PR #${process.env.SOURCE_ISSUE} into ${process.env.TARGET_BRANCH}`,
69
+
head: `${userName}:${branchName}`,
70
+
base: process.env.TARGET_BRANCH,
71
+
body:
72
+
`This cherry-pick was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.SOURCE_ISSUE}
73
+
Please review the diff and merge if no changes are unexpected.
74
+
You can view the cherry-pick log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).
75
+
76
+
cc ${reviewers.map(r=>"@"+r).join(" ")}`,
77
+
});
78
+
constnum=r.data.number;
79
+
console.log(`Pull request ${num} created.`);
80
+
81
+
awaitgh.issues.createComment({
82
+
number: +process.env.SOURCE_ISSUE,
83
+
owner: "Microsoft",
84
+
repo: "TypeScript",
85
+
body: `Hey @${process.env.REQUESTING_USER}, I've opened #${num} for you.`
86
+
});
87
+
}
88
+
89
+
main().catch(asynce=>{
90
+
console.error(e);
91
+
process.exitCode=1;
92
+
if(process.env.SOURCE_ISSUE){
93
+
constgh=newOctokit();
94
+
gh.authenticate({
95
+
type: "token",
96
+
token: process.argv[2]
97
+
});
98
+
awaitgh.issues.createComment({
99
+
number: +process.env.SOURCE_ISSUE,
100
+
owner: "Microsoft",
101
+
repo: "TypeScript",
102
+
body: `Hey @${process.env.REQUESTING_USER}, I couldn't open a PR with the cherry-pick. ([You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary)). You may need to squash and pick this PR into ${process.env.TARGET_BRANCH} manually.`
`${process.env.source_issue ? `This test run was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.source_issue} `+"\n" : ""}Please review the diff and merge if no changes are unexpected.
39
+
`${process.env.SOURCE_ISSUE ? `This test run was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.SOURCE_ISSUE} `+"\n" : ""}Please review the diff and merge if no changes are unexpected.
40
40
You can view the build log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).
body: `Hey @${process.env.REQUESTING_USER}, I've packed this into [an installable tgz](${link}). You can install it for testing by referencing it in your \`package.json\` like so:
36
+
\`\`\`
37
+
{
38
+
"devDependencies": {
39
+
"typescript": "${link}"
40
+
}
41
+
}
42
+
\`\`\`
43
+
and then running \`npm install\`.
44
+
`
45
+
});
46
+
}
47
+
48
+
main().catch(asynce=>{
49
+
console.error(e);
50
+
process.exitCode=1;
51
+
if(process.env.SOURCE_ISSUE){
52
+
constgh=newOctokit();
53
+
gh.authenticate({
54
+
type: "token",
55
+
token: process.argv[2]
56
+
});
57
+
awaitgh.issues.createComment({
58
+
number: +process.env.SOURCE_ISSUE,
59
+
owner: "Microsoft",
60
+
repo: "TypeScript",
61
+
body: `Hey @${process.env.REQUESTING_USER}, something went wrong when looking for the build artifact. ([You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary)).`
0 commit comments