List all workflow runs in the project.
(self)
| 1318 | return value |
| 1319 | |
| 1320 | def list_runs(self) -> list[dict[str, Any]]: |
| 1321 | """List all workflow runs in the project.""" |
| 1322 | runs_dir = self.project_root / ".specify" / "workflows" / "runs" |
| 1323 | if not runs_dir.exists(): |
| 1324 | return [] |
| 1325 | |
| 1326 | runs: list[dict[str, Any]] = [] |
| 1327 | for run_dir in sorted(runs_dir.iterdir()): |
| 1328 | if not run_dir.is_dir(): |
| 1329 | continue |
| 1330 | state_path = run_dir / "state.json" |
| 1331 | if state_path.exists(): |
| 1332 | with open(state_path, encoding="utf-8") as f: |
| 1333 | state_data = json.load(f) |
| 1334 | runs.append(state_data) |
| 1335 | return runs |
| 1336 | |
| 1337 | |
| 1338 | class WorkflowAbortError(Exception): |