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

Function fetchCommitStatuses

pkg/cli/checks_command.go:283–296  ·  view source on GitHub ↗

fetchCommitStatuses fetches commit statuses (legacy Status API) for a commit SHA.

(repoOverride string, sha string)

Source from the content-addressed store, hash-verified

281
282// fetchCommitStatuses fetches commit statuses (legacy Status API) for a commit SHA.
283func 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.

Callers 1

FetchChecksResultFunction · 0.85

Calls 2

execGHAPIFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected