@@ -467,43 +467,54 @@ export default class PRChecker {
467467 }
468468
469469 if ( ! GITHUB_SUCCESS_CONCLUSIONS . includes ( conclusion ) ) {
470- hasFailures = true ;
470+ const runs = checkRuns ?. nodes ?? [ ] ;
471+ const allRunsSkipped = runs . length > 0 &&
472+ runs . length === checkRuns . totalCount &&
473+ runs . every ( ( checkRun ) => checkRun . status === 'COMPLETED' &&
474+ checkRun . conclusion === 'SKIPPED' ) ;
475+
476+ // GitHub can report a STARTUP_FAILURE for a workflow even though all
477+ // of its conditional jobs were skipped. There is no failed check in
478+ // that case, so the suite should not make the commit unlandable.
479+ if ( conclusion === 'STARTUP_FAILURE' && allRunsSkipped ) {
480+ continue ;
481+ }
471482
472- // If we have detailed checkRuns, show specific failing jobs
473- if ( checkRuns && checkRuns . nodes && checkRuns . nodes . length > 0 ) {
474- for ( const checkRun of checkRuns . nodes ) {
475- if ( checkRun . status === 'COMPLETED' &&
476- ! GITHUB_SUCCESS_CONCLUSIONS . includes ( checkRun . conclusion ) ) {
477- if ( checkRun . conclusion === 'CANCELLED' ) {
478- cancelledJobs . push ( {
479- name : checkRun . name ,
480- conclusion : checkRun . conclusion ,
481- url : checkRun . detailsUrl
482- } ) ;
483- } else {
484- failedJobs . push ( {
485- name : checkRun . name ,
486- conclusion : checkRun . conclusion ,
487- url : checkRun . detailsUrl
488- } ) ;
489- }
483+ hasFailures = true ;
484+ let reportedFailure = false ;
485+
486+ // If we have detailed checkRuns, show specific failing jobs.
487+ for ( const checkRun of runs ) {
488+ if ( checkRun . status === 'COMPLETED' &&
489+ ! GITHUB_SUCCESS_CONCLUSIONS . includes ( checkRun . conclusion ) ) {
490+ reportedFailure = true ;
491+ if ( checkRun . conclusion === 'CANCELLED' ) {
492+ cancelledJobs . push ( {
493+ name : checkRun . name ,
494+ conclusion : checkRun . conclusion ,
495+ url : checkRun . detailsUrl
496+ } ) ;
497+ } else {
498+ failedJobs . push ( {
499+ name : checkRun . name ,
500+ conclusion : checkRun . conclusion ,
501+ url : checkRun . detailsUrl
502+ } ) ;
490503 }
491504 }
492- } else {
493- // Fallback to check suite level information if no checkRuns
494- if ( conclusion === 'CANCELLED' ) {
495- cancelledJobs . push ( {
496- name : GITHUB_ACTIONS_APP ,
497- conclusion,
498- url : null
499- } ) ;
500- } else {
501- failedJobs . push ( {
502- name : GITHUB_ACTIONS_APP ,
503- conclusion,
504- url : null
505- } ) ;
506- }
505+ }
506+
507+ // Fall back to the suite when its failed conclusion is not reflected
508+ // by an individual check run.
509+ if ( ! reportedFailure ) {
510+ const failures = conclusion === 'CANCELLED'
511+ ? cancelledJobs
512+ : failedJobs ;
513+ failures . push ( {
514+ name : GITHUB_ACTIONS_APP ,
515+ conclusion,
516+ url : null
517+ } ) ;
507518 }
508519 }
509520 }
0 commit comments