MCPcopy Create free account
hub / github.com/github/gh-aw / fetchCheckRuns

Function fetchCheckRuns

pkg/cli/checks_command.go:261–274  ·  view source on GitHub ↗

fetchCheckRuns fetches check runs for a commit SHA.

(repoOverride string, sha string)

Source from the content-addressed store, hash-verified

259
260// fetchCheckRuns fetches check runs for a commit SHA.
261func 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.
277type commitStatusAPIResponse struct {

Callers 1

FetchChecksResultFunction · 0.85

Calls 2

execGHAPIFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected