(targetRepo: string, sha: string, name: string)
| 100 | } |
| 101 | |
| 102 | function checkRunsForCommit(targetRepo: string, sha: string, name: string): { id?: number }[] { |
| 103 | const encodedName = encodeURIComponent(name); |
| 104 | try { |
| 105 | const raw = run("gh", [ |
| 106 | "api", |
| 107 | `repos/${targetRepo}/commits/${sha}/check-runs?check_name=${encodedName}`, |
| 108 | "--jq", |
| 109 | ".check_runs", |
| 110 | ]); |
| 111 | const parsed = JSON.parse(raw) as unknown; |
| 112 | return Array.isArray(parsed) ? (parsed as { id?: number }[]) : []; |
| 113 | } catch { |
| 114 | return []; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | export function publishCheckFromReport(options: PublishCheckOptions): void { |
| 119 | const markdown = readFileSync(options.reportPath, "utf8"); |
no test coverage detected