@@ -430,25 +430,21 @@ if [[ -n "$repo_owner" && ${#pr_number_to_branch[@]} -gt 0 ]]; then
430430 else $valid
431431 end) as $filtered |
432432
433- # CheckRun nodes: running if status exists and != COMPLETED
434- ($filtered | map(select(
435- .status != null and .status != "COMPLETED"
436- )) | length) as $cr_running |
437- # CheckRun nodes: failed conclusions
433+ # any_running: use ALL checks (not just filtered/required) so
434+ # non-required in-progress checks keep overall status as pending
435+ (([$valid[] | select(
436+ (.status != null and .status != "COMPLETED") or
437+ (.cState != null and (.cState | IN("PENDING", "EXPECTED")))
438+ )] | length) > 0) as $any_running |
439+ # Failed: only from filtered (required) checks
438440 ($filtered | map(select(
439441 .conclusion != null and
440442 (.conclusion | IN("FAILURE", "TIMED_OUT", "ERROR", "STARTUP_FAILURE", "ACTION_REQUIRED"))
441443 )) | length) as $cr_failed |
442- # StatusContext nodes: running (PENDING/EXPECTED)
443- ($filtered | map(select(
444- .cState != null and (.cState | IN("PENDING", "EXPECTED"))
445- )) | length) as $sc_running |
446- # StatusContext nodes: failed
447444 ($filtered | map(select(
448445 .cState != null and (.cState | IN("FAILURE", "ERROR"))
449446 )) | length) as $sc_failed |
450447
451- (($cr_running + $sc_running) > 0) as $any_running |
452448 (($cr_failed + $sc_failed) > 0) as $any_failed |
453449
454450 if $any_running and $any_failed then
0 commit comments