Skip to content

Commit

Permalink
Add job conclusion support
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Dec 19, 2024
1 parent 9026b08 commit 6a6a6e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Workflow:
name: str
status: str
path: Path
conclusion: str = ""
branch: str = "-"
started_at: datetime.datetime | None = None
updated_at: datetime.datetime | None = None
Expand All @@ -51,7 +52,7 @@ def check(self) -> str:
Checkmark.
"""
if self.status == "completed":
return "✅"
return "✅" if self.conclusion == "success" else "❌"
if self.status == "in_progress":
return "🕒"
if self.status == "queued":
Expand Down Expand Up @@ -201,6 +202,8 @@ def get_workflow(path: Path) -> Workflow | None:
"--json",
"status",
"--json",
"conclusion",
"--json",
"startedAt",
"--json",
"updatedAt",
Expand All @@ -226,6 +229,7 @@ def get_workflow(path: Path) -> Workflow | None:
return Workflow(
name=get_workflow_name(path),
status=data["status"],
conclusion=data["conclusion"],
started_at=datetime.datetime.fromisoformat(data["startedAt"]),
updated_at=datetime.datetime.fromisoformat(data["updatedAt"]),
branch=data["headBranch"],
Expand Down

0 comments on commit 6a6a6e1

Please sign in to comment.