Ignore cancelled runs in completed CI badge
next-build / build (push) Canceled after 0s

This commit is contained in:
2026-10-14 19:58:25 -06:00
parent 9f7d8ebb51
commit 4f21677ae5
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ def latest_completed(api: str, repo: str, workflow: str, branch: str,
for run in runs:
if run.get("head_branch") != branch or run.get("status") != "completed":
continue
if run.get("conclusion") not in ("success", "failure", "cancelled", "skipped"):
if run.get("conclusion") not in ("success", "failure"):
continue
candidate = (int(run["id"]), run["conclusion"])
if latest is None or candidate[0] > latest[0]:
+1
View File
@@ -15,6 +15,7 @@ spec.loader.exec_module(module)
def runs(_url, _token):
return {"workflow_runs": [
{"id": 105, "head_branch": "main", "status": "completed", "conclusion": "cancelled"},
{"id": 104, "head_branch": "main", "status": "queued", "conclusion": None},
{"id": 103, "head_branch": "main", "status": "completed", "conclusion": "failure"},
{"id": 102, "head_branch": "main", "status": "completed", "conclusion": "success"},