Skip to content

Commit 4ccb045

Browse files
committed
fix checks validation
1 parent c1bb8eb commit 4ccb045

1 file changed

Lines changed: 11 additions & 21 deletions

File tree

.github/workflows/auto-complete-pr.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,30 +63,20 @@ jobs:
6363
break
6464
}
6565
66-
$failedChecks = $checksJson | Where-Object {
67-
$_.conclusion -notin @("success", "skipped", "neutral") -and $_.status -eq "completed"
66+
$allChecksPassed = $true
67+
foreach ($check in $checksJson) {
68+
Write-Host " - $($check.name): $($check.state)"
69+
if ($check.state -ne "SUCCESS") {
70+
$allChecksPassed = $false
71+
break;
72+
}
6873
}
6974
70-
$pendingChecks = $checksJson | Where-Object {
71-
$_.status -ne "completed"
75+
if (-not $allChecksPassed) {
76+
Write-Host " Skipping: Not all checks passed"
77+
continue
7278
}
73-
74-
if ($failedChecks.Count -gt 0) {
75-
Write-Host " Failed checks found:"
76-
foreach ($check in $failedChecks) {
77-
Write-Host " - $($check.name): $($check.conclusion)"
78-
}
79-
continue
80-
}
81-
82-
if ($pendingChecks.Count -gt 0) {
83-
Write-Host " Pending checks found:"
84-
foreach ($check in $pendingChecks) {
85-
Write-Host " - $($check.name): $($check.status)"
86-
}
87-
continue
88-
}
89-
79+
9080
Write-Host " All checks passed!"
9181
$completablePr = $pr
9282
break

0 commit comments

Comments
 (0)