File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ inputs:
1111 number :
1212 description : ' Pull Request number'
1313 required : true
14+ repo :
15+ description : ' Pull Request repo in owner/repo format'
16+ required : false
1417runs :
1518 using : ' node12'
1619 main : ' dist/index.js'
Original file line number Diff line number Diff line change @@ -6,11 +6,20 @@ const { GitHub, context } = require('@actions/github')
66const main = async ( ) => {
77 const token = core . getInput ( 'github-token' )
88 const number = core . getInput ( 'number' )
9+ const repoString = core . getInput ( 'repo' )
10+
11+ let repoObject
12+ if ( repoString ) {
13+ const [ owner , repo ] = repoString . split ( '/' )
14+ repoObject = { owner, repo }
15+ } else {
16+ repoObject = context . repo
17+ }
918
1019 const octokit = new GitHub ( token )
1120
1221 await octokit . pulls . createReview ( {
13- ...context . repo ,
22+ ...repoObject ,
1423 pull_number : number ,
1524 event : 'APPROVE'
1625 } )
You can’t perform that action at this time.
0 commit comments