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
44
+
["git",["checkout","-b",branchName]],// create a new branch
45
+
["git",["cherry-pick",squashSha]],//
46
+
["git",["remote","add","fork",remoteUrl]],// Add the remote fork
47
+
["git",["push","--set-upstream","fork",branchName,"-f"]]// push the branch
48
+
]);
49
+
50
+
constgh=newOctokit();
51
+
gh.authenticate({
52
+
type: "token",
53
+
token: process.argv[2]
54
+
});
55
+
constr=awaitgh.pulls.create({
56
+
owner: "Microsoft",
57
+
repo: "TypeScript",
58
+
maintainer_can_modify: true,
59
+
title: `🤖 Cherry-pick PR #${process.env.SOURCE_ISSUE} into ${process.env.TARGET_BRANCH}`,
60
+
head: `${userName}:${branchName}`,
61
+
base: process.env.TARGET_BRANCH,
62
+
body:
63
+
`This cherry-pick was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.SOURCE_ISSUE}
64
+
Please review the diff and merge if no changes are unexpected.
65
+
You can view the cherry-pick log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).
66
+
67
+
cc ${reviewers.map(r=>"@"+r).join(" ")}`,
68
+
});
69
+
constnum=r.data.number;
70
+
console.log(`Pull request ${num} created.`);
71
+
72
+
awaitgh.issues.createComment({
73
+
number: +process.env.SOURCE_ISSUE,
74
+
owner: "Microsoft",
75
+
repo: "TypeScript",
76
+
body: `Hey @${process.env.REQUESTING_USER}, I've opened #${num} for you.`
77
+
});
78
+
}
79
+
80
+
main().catch(asynce=>{
81
+
console.error(e);
82
+
process.exitCode=1;
83
+
constgh=newOctokit();
84
+
gh.authenticate({
85
+
type: "token",
86
+
token: process.argv[2]
87
+
});
88
+
awaitgh.issues.createComment({
89
+
number: +process.env.SOURCE_ISSUE,
90
+
owner: "Microsoft",
91
+
repo: "TypeScript",
92
+
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.`
0 commit comments