Add workflow.finish (completed, parked, waiting_approval, declined). A failed step parks the run unless it continues on failure, and a parked run retries from a top-level step, replaying the earlier steps' recorded results. Adds the retry-run operation and a Retry button on the run page.
27 lines
658 B
TypeScript
27 lines
658 B
TypeScript
/** The Badge and StatusDot tone for a run, approval or effect state the server
|
|
* reports. A state this build does not know reads as idle. */
|
|
export function stateTone(state: string): "ok" | "warn" | "danger" | "info" | "idle" {
|
|
switch (state) {
|
|
case "succeeded":
|
|
case "approved":
|
|
case "done":
|
|
return "ok";
|
|
case "waiting":
|
|
case "waiting_approval":
|
|
case "parked":
|
|
case "pending":
|
|
case "unknown":
|
|
return "warn";
|
|
case "failed":
|
|
case "denied":
|
|
case "expired":
|
|
case "refused":
|
|
return "danger";
|
|
case "running":
|
|
case "queued":
|
|
return "info";
|
|
default:
|
|
return "idle";
|
|
}
|
|
}
|