@@ -12,9 +12,9 @@ const createChecks = async (context, payload, actionObj) => {
1212 // Note: octokit (wrapped by probot) requires head_branch.
1313 // Contradicting API docs that only requires head_sha
1414 // --> https://developer.github.com/v3/checks/runs/#create-a-check-run
15- if ( context . payload . checksuite ) {
16- params . head_branch = context . payload . checksuite . head_branch
17- params . head_sha = context . payload . checksuite . head_sha
15+ if ( context . payload . check_suite ) {
16+ params . head_branch = context . payload . check_suite . head_branch
17+ params . head_sha = context . payload . check_suite . head_sha
1818 } else if ( context . eventName === 'issue_comment' ) {
1919 const issueNumber = context . payload . issue . number
2020 const pullRequest = ( await actionObj . githubAPI . getPR ( context , issueNumber ) ) . data
@@ -104,6 +104,9 @@ class Checks extends Action {
104104 }
105105
106106 async beforeValidate ( context , settings , name ) {
107+ if ( context . eventName === 'issue_comment' && ! context . payload . issue ?. pull_request ) {
108+ return Promise . resolve ( )
109+ }
107110 const result = await createChecks ( context , {
108111 status : 'in_progress' ,
109112 output : {
@@ -127,10 +130,16 @@ class Checks extends Action {
127130 }
128131
129132 async run ( { context, settings, payload } ) {
133+ if ( context . eventName === 'issue_comment' && ! context . payload . issue ?. pull_request ) {
134+ return Promise . resolve ( )
135+ }
130136 await createChecks ( context , payload , this )
131137 }
132138
133139 async afterValidate ( context , settings , name , results ) {
140+ if ( context . eventName === 'issue_comment' && ! context . payload . issue ?. pull_request ) {
141+ return Promise . resolve ( )
142+ }
134143 const checkRunResult = this . checkRunResult . get ( name )
135144 const payload = settings . payload ? this . populatePayloadWithResult ( settings . payload , results , context ) : undefined
136145
0 commit comments