Skip to content

Commit 077aedc

Browse files
committed
back to passing auth in the ctor I GUESS
1 parent 4947b31 commit 077aedc

File tree

4 files changed

+12
-24
lines changed

4 files changed

+12
-24
lines changed

scripts/open-cherry-pick-pr.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ async function main() {
2727
["git", ["log", "-1", `--pretty="%aN <%aE>"`]]
2828
]);
2929

30-
const gh = new Octokit();
31-
gh.authenticate({
32-
type: "token",
33-
token: process.argv[2]
30+
const gh = new Octokit({
31+
auth: process.argv[2]
3432
});
3533

3634
const inputPR = (await gh.pulls.get({ pull_number: +process.env.SOURCE_ISSUE, owner: "microsoft", repo: "TypeScript" })).data;
@@ -112,10 +110,8 @@ main().catch(async e => {
112110
console.error(e);
113111
process.exitCode = 1;
114112
if (process.env.SOURCE_ISSUE) {
115-
const gh = new Octokit();
116-
gh.authenticate({
117-
type: "token",
118-
token: process.argv[2]
113+
const gh = new Octokit({
114+
auth: process.argv[2]
119115
});
120116
await gh.issues.createComment({
121117
issue_number: +process.env.SOURCE_ISSUE,

scripts/open-user-pr.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ runSequence([
2424
["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch
2525
]);
2626

27-
const gh = new Octokit();
28-
gh.authenticate({
29-
type: "token",
30-
token: process.argv[2]
27+
const gh = new Octokit({
28+
auth: process.argv[2]
3129
});
3230
gh.pulls.create({
3331
owner: process.env.TARGET_FORK!,

scripts/perf-result-post.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ const outputTableText = fs.readFileSync(process.argv[3], { encoding: "utf8" });
1212
console.log(`Fragment contents:
1313
${outputTableText}`);
1414

15-
const gh = new Octokit();
16-
gh.authenticate({
17-
type: "token",
18-
token: process.argv[2]
15+
const gh = new Octokit({
16+
auth: process.argv[2]
1917
});
2018
gh.issues.createComment({
2119
issue_number: +source,

scripts/post-vsts-artifact-comment.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ async function main() {
2323
const tgzUrl = new URL(artifact.resource.url);
2424
tgzUrl.search = `artifactName=tgz&fileId=${file.blob.id}&fileName=${file.path}`;
2525
const link = "" + tgzUrl;
26-
const gh = new Octokit();
27-
gh.authenticate({
28-
type: "token",
29-
token: process.argv[2]
26+
const gh = new Octokit({
27+
auth: process.argv[2]
3028
});
3129

3230
// Please keep the strings "an installable tgz" and "packed" in this message, as well as the devDependencies section,
@@ -57,10 +55,8 @@ main().catch(async e => {
5755
console.error(e);
5856
process.exitCode = 1;
5957
if (process.env.SOURCE_ISSUE) {
60-
const gh = new Octokit();
61-
gh.authenticate({
62-
type: "token",
63-
token: process.argv[2]
58+
const gh = new Octokit({
59+
auth: process.argv[2]
6460
});
6561
await gh.issues.createComment({
6662
issue_number: +process.env.SOURCE_ISSUE,

0 commit comments

Comments
 (0)