Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,14 @@ def filter_workflow_runs(run, issue):

print(f"Success rate: {success_rate}")

# Check if last 5 runs are all failures
last_5_failed = len(workflow_runs) >= 5 and all(run.status == "failure" for run in workflow_runs[:5])
# Check if last 5 runs are all failures or cancelled (e.g. job timeout)
last_5_failed = len(workflow_runs) >= 5 and all(
run.status in ("failure", "cancelled") for run in workflow_runs[:5]
)
if last_5_failed:
print(f"The last 5 workflow runs for {workflow.name} have all failed")
print(
f"The last 5 workflow runs for {workflow.name} have all failed or been cancelled"
)

return success_rate < workflow.threshold or last_5_failed

Expand Down
Loading