@@ -450,7 +450,7 @@ async function run() {
450450
451451 case "check_run" :
452452 if ( auto_merge ) {
453- context . payload . check_run . pull_requests . forEach ( async function ( element ) {
453+ for ( const element of context . payload . check_run . pull_requests ) {
454454 const pullResponse = await client . pulls . get ( {
455455 owner,
456456 pull_number : element . number ,
@@ -464,7 +464,7 @@ async function run() {
464464 else {
465465 core . info ( `Pull request #${ element . number } does not have the label ${ label } . Skipping...` ) ;
466466 }
467- } ) ;
467+ }
468468 }
469469 else {
470470 core . info ( "Auto merge is disabled. You should remove the `check_run` event from the action configuration. Skipping..." ) ;
@@ -475,6 +475,7 @@ async function run() {
475475 catch ( err ) {
476476 //Even if it's a valid situation, we want to fail the action in order to be able to find the issue and fix it.
477477 core . setFailed ( err . message ) ;
478+ core . debug ( JSON . stringify ( err ) ) ;
478479 }
479480}
480481
@@ -496,7 +497,7 @@ async function push() {
496497 repo,
497498 state : "open" ,
498499 } ) ;
499- core . debug ( pulls . data ) ;
500+ core . debug ( JSON . stringify ( pulls . data ) ) ;
500501 let pull_number ;
501502 if ( pulls . data . length == 1 ) {
502503 const data = pulls . data [ 0 ] ;
@@ -524,7 +525,7 @@ async function push() {
524525 issue_number : pull_number ,
525526 labels : [ label ] ,
526527 owner,
527- repo
528+ repo,
528529 } ) ;
529530 core . info ( `Label ${ label } added to #${ pull_number } .` ) ;
530531 core . debug ( JSON . stringify ( labelsResponse . data ) ) ;
0 commit comments