File tree 1 file changed +21
-17
lines changed
1 file changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -17,32 +17,36 @@ gh.authenticate({
17
17
type : "token" ,
18
18
token : process . argv [ 2 ]
19
19
} ) ;
20
- gh . issues . createComment ( {
21
- number : + source ,
22
- owner : "Microsoft" ,
23
- repo : "TypeScript" ,
24
- body : `@${ requester }
25
- The results of the perf run you requested are in! Here they are:
26
20
27
- ${ outputTableText } `
28
- } ) . then ( async data => {
29
- console . log ( `Results posted!` ) ;
30
- const newCommentUrl = data . data . html_url ;
31
- const comment = await gh . issues . getComment ( {
21
+ async function main ( ) {
22
+ const existingComment = await gh . issues . getComment ( {
32
23
owner : "Microsoft" ,
33
24
repo : "TypeScript" ,
34
25
comment_id : + postedComment
35
26
} ) ;
36
- const newBody = `${ comment . data . body }
37
27
38
- Update: [The results are in!](${ newCommentUrl } )` ;
39
- return await gh . issues . updateComment ( {
28
+ const gist = await gh . gists . create ( {
29
+ files : { "index.md" : { content : outputTableText } } ,
30
+ description : `Perf results for ${ existingComment . data . html_url } ` ,
31
+ public : true
32
+ } ) ;
33
+
34
+ await gh . issues . createComment ( {
35
+ number : + source ,
36
+ owner : "Microsoft" ,
37
+ repo : "TypeScript" ,
38
+ body : `@${ requester } \The results of the perf run you requested are in! They can be found at: ${ gist . data . html_url } `
39
+ } ) ;
40
+
41
+ await gh . issues . updateComment ( {
40
42
owner : "Microsoft" ,
41
43
repo : "TypeScript" ,
42
44
comment_id : + postedComment ,
43
- body : newBody
45
+ body : ` ${ existingComment . data . body } \n\nUpdate: [The results are in!]( ${ gist . data . html_url } )`
44
46
} ) ;
45
- } ) . catch ( e => {
47
+ }
48
+
49
+ main ( ) . catch ( e => {
46
50
console . error ( e ) ;
47
51
process . exit ( 1 ) ;
48
- } ) ;
52
+ } ) ;
You can’t perform that action at this time.
0 commit comments