1919async function run ( core , context , github ) {
2020
2121 try {
22- const owner = process . env . PROVIDER ;
23- const repo = process . env . REPOSITORY ;
22+ const owner = context . repo . owner ;
23+ const repo = context . repo . repo ;
2424 const reRunCmd = process . env . RERUN_CMD ;
2525 const comment = context . payload . comment . body ;
2626
2727 if ( comment !== reRunCmd ) {
28- console . log ( "this is not a bot command" ) ;
28+ core . info ( "this is not a bot command" ) ;
2929 return ;
3030 }
3131
@@ -35,13 +35,13 @@ async function run(core, context, github) {
3535 sha : prRef ,
3636 }
3737 }
38- } = await github . pulls . get ( {
38+ } = await github . rest . pulls . get ( {
3939 owner,
4040 repo,
4141 pull_number : context . issue . number ,
4242 } ) ;
4343
44- const jobs = await github . checks . listForRef ( {
44+ const jobs = await github . rest . checks . listForRef ( {
4545 owner,
4646 repo,
4747 ref : prRef ,
@@ -50,8 +50,8 @@ async function run(core, context, github) {
5050
5151 jobs . data . check_runs . forEach ( job => {
5252 if ( job . conclusion === 'failure' || job . conclusion === 'cancelled' ) {
53- console . log ( "rerun job " + job . name ) ;
54- github . checks . rerequestSuite ( {
53+ core . info ( "rerun job " + job . name ) ;
54+ github . rest . checks . rerequestSuite ( {
5555 owner,
5656 repo,
5757 check_suite_id : job . check_suite . id
0 commit comments