File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,7 @@ function padNum(number: number) {
18
18
}
19
19
20
20
const 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" ] ;
25
22
const now = new Date ( ) ;
26
23
const branchName = `user-update-${ process . env . TARGET_FORK } -${ now . getFullYear ( ) } ${ padNum ( now . getMonth ( ) ) } ${ padNum ( now . getDay ( ) ) } ${ process . env . TARGET_BRANCH ? "-" + process . env . TARGET_BRANCH : "" } ` ;
27
24
const remoteUrl = `https://${ process . argv [ 2 ] } @github.com/${ userName } /TypeScript.git` ;
@@ -55,13 +52,15 @@ cc ${reviewers.map(r => "@" + r).join(" ")}`,
55
52
} ) . then ( async r => {
56
53
const num = r . data . number ;
57
54
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 {
65
64
await gh . issues . createComment ( {
66
65
number : + process . env . source_issue ,
67
66
owner : "Microsoft" ,
You can’t perform that action at this time.
0 commit comments