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

Method ListStatuses

github/repos_statuses.go:51–70  ·  view source on GitHub ↗

ListStatuses lists the statuses of a repository at the specified reference. The ref can be a SHA, a branch name, or a tag name. GitHub API docs: https://docs.github.com/rest/commits/statuses?apiVersion=2022-11-28#list-commit-statuses-for-a-reference meta:operation GET /repos/{owner}/{repo}/commits

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

Source from the content-addressed store, hash-verified

49//
50//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/statuses
51func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) {
52 u := fmt.Sprintf("repos/%v/%v/commits/%v/statuses", owner, repo, refURLEscape(ref))
53 u, err := addOptions(u, opts)
54 if err != nil {
55 return nil, nil, err
56 }
57
58 req, err := s.client.NewRequest(ctx, "GET", u, nil)
59 if err != nil {
60 return nil, nil, err
61 }
62
63 var statuses []*RepoStatus
64 resp, err := s.client.Do(req, &statuses)
65 if err != nil {
66 return nil, resp, err
67 }
68
69 return statuses, resp, nil
70}
71
72// CreateStatus creates a new status for a repository at the specified
73// reference. The ref can be a SHA, a branch name, or a tag name.

Calls 4

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