MCPcopy Index your code
hub / github.com/google/go-github / ListCheckRunsForRef

Method ListCheckRunsForRef

github/checks.go:278–299  ·  view source on GitHub ↗

ListCheckRunsForRef lists check runs for a specific ref. The ref can be a commit SHA, branch name `heads/ `, or tag name `tags/ `. For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References. GitHub API docs: h

(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions)

Source from the content-addressed store, hash-verified

276//
277//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-runs
278func (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) {
279 u := fmt.Sprintf("repos/%v/%v/commits/%v/check-runs", owner, repo, refURLEscape(ref))
280 u, err := addOptions(u, opts)
281 if err != nil {
282 return nil, nil, err
283 }
284
285 req, err := s.client.NewRequest(ctx, "GET", u, nil)
286 if err != nil {
287 return nil, nil, err
288 }
289
290 req.Header.Set("Accept", mediaTypeCheckRunsPreview)
291
292 var checkRunResults *ListCheckRunsResults
293 resp, err := s.client.Do(req, &checkRunResults)
294 if err != nil {
295 return nil, resp, err
296 }
297
298 return checkRunResults, resp, nil
299}
300
301// ListCheckRunsCheckSuite lists check runs for a check suite.
302//

Calls 4

refURLEscapeFunction · 0.85
addOptionsFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 1