File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,10 +18,7 @@ function padNum(number: number) {
1818}
1919
2020const userName = process . env . GH_USERNAME ;
21- const reviewers = [ "weswigham" , "sandersn" , "RyanCavanaugh" ] ;
22- if ( process . env . requesting_user && reviewers . indexOf ( process . env . requesting_user ) === - 1 ) {
23- reviewers . push ( process . env . requesting_user ) ;
24- }
21+ const reviewers = process . env . requesting_user ? [ process . env . requesting_user ] : [ "weswigham" , "sandersn" , "RyanCavanaugh" ] ;
2522const now = new Date ( ) ;
2623const branchName = `user-update-${ process . env . TARGET_FORK } -${ now . getFullYear ( ) } ${ padNum ( now . getMonth ( ) ) } ${ padNum ( now . getDay ( ) ) } ${ process . env . TARGET_BRANCH ? "-" + process . env . TARGET_BRANCH : "" } ` ;
2724const remoteUrl = `https://${ process . argv [ 2 ] } @github.com/${ userName } /TypeScript.git` ;
@@ -55,13 +52,15 @@ cc ${reviewers.map(r => "@" + r).join(" ")}`,
5552} ) . then ( async r => {
5653 const num = r . data . number ;
5754 console . log ( `Pull request ${ num } created.` ) ;
58- await gh . pulls . createReviewRequest ( {
59- owner : process . env . TARGET_FORK ,
60- repo : "TypeScript" ,
61- number : num ,
62- reviewers,
63- } ) ;
64- if ( process . env . source_issue ) {
55+ if ( ! process . env . source_issue ) {
56+ await gh . pulls . createReviewRequest ( {
57+ owner : process . env . TARGET_FORK ,
58+ repo : "TypeScript" ,
59+ number : num ,
60+ reviewers,
61+ } ) ;
62+ }
63+ else {
6564 await gh . issues . createComment ( {
6665 number : + process . env . source_issue ,
6766 owner : "Microsoft" ,
You can’t perform that action at this time.
0 commit comments