fetchCommitStatuses fetches commit statuses (legacy Status API) for a commit SHA.
(repoOverride string, sha string)
| 281 | |
| 282 | // fetchCommitStatuses fetches commit statuses (legacy Status API) for a commit SHA. |
| 283 | func fetchCommitStatuses(repoOverride string, sha string) ([]PRCommitStatus, error) { |
| 284 | output, err := execGHAPI(repoOverride, sha, |
| 285 | "api", "repos/{owner}/{repo}/commits/"+sha+"/status") |
| 286 | if err != nil { |
| 287 | return nil, err |
| 288 | } |
| 289 | |
| 290 | var resp commitStatusAPIResponse |
| 291 | if err := json.Unmarshal(output, &resp); err != nil { |
| 292 | return nil, fmt.Errorf("failed to parse commit status response: %w", err) |
| 293 | } |
| 294 | |
| 295 | return resp.Statuses, nil |
| 296 | } |
| 297 | |
| 298 | // policyCheckPatterns are patterns that indicate a policy/account-gate check rather than a |
| 299 | // product failure. These names come from GitHub's branch-protection rule enforcement. |
no test coverage detected