-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release-3.4
- Loading branch information
Showing
132 changed files
with
4,816 additions
and
1,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// @ts-check | ||
/// <reference lib="esnext.asynciterable" /> | ||
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally | ||
const Octokit = require("@octokit/rest"); | ||
const fs = require("fs"); | ||
|
||
const requester = process.env.requesting_user; | ||
const source = process.env.source_issue; | ||
const postedComment = process.env.status_comment; | ||
console.log(`Loading fragment from ${process.argv[3]}...`); | ||
const outputTableText = fs.readFileSync(process.argv[3], { encoding: "utf8" }); | ||
console.log(`Fragment contents: | ||
${outputTableText}`); | ||
|
||
const gh = new Octokit(); | ||
gh.authenticate({ | ||
type: "token", | ||
token: process.argv[2] | ||
}); | ||
gh.issues.createComment({ | ||
number: +source, | ||
owner: "Microsoft", | ||
repo: "TypeScript", | ||
body: `@${requester} | ||
The results of the perf run you requested are in! Here they are: | ||
${outputTableText}` | ||
}).then(async data => { | ||
console.log(`Results posted!`); | ||
const newCommentUrl = data.data.html_url; | ||
const comment = await gh.issues.getComment({ | ||
owner: "Microsoft", | ||
repo: "TypeScript", | ||
comment_id: +postedComment | ||
}); | ||
const newBody = `${comment.data.body} | ||
Update: [The results are in!](${newCommentUrl})`; | ||
return await gh.issues.updateComment({ | ||
owner: "Microsoft", | ||
repo: "TypeScript", | ||
comment_id: +postedComment, | ||
body: newBody | ||
}); | ||
}).catch(e => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.