fetchCheckRuns fetches check runs for a commit SHA.
(repoOverride string, sha string)
| 259 | |
| 260 | // fetchCheckRuns fetches check runs for a commit SHA. |
| 261 | func fetchCheckRuns(repoOverride string, sha string) ([]PRCheckRun, error) { |
| 262 | output, err := execGHAPI(repoOverride, sha, |
| 263 | "api", "repos/{owner}/{repo}/commits/"+sha+"/check-runs", "--paginate") |
| 264 | if err != nil { |
| 265 | return nil, err |
| 266 | } |
| 267 | |
| 268 | var resp checkRunsAPIResponse |
| 269 | if err := json.Unmarshal(output, &resp); err != nil { |
| 270 | return nil, fmt.Errorf("failed to parse check runs response: %w", err) |
| 271 | } |
| 272 | |
| 273 | return resp.CheckRuns, nil |
| 274 | } |
| 275 | |
| 276 | // commitStatusAPIResponse is the envelope returned by the statuses endpoint. |
| 277 | type commitStatusAPIResponse struct { |
no test coverage detected