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

Method CreateStatus

github/repos_statuses.go:78–92  ·  view source on GitHub ↗

CreateStatus creates a new status for 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#create-a-commit-status meta:operation POST /repos/{owner}/{repo}/statuses/{sha}

(ctx context.Context, owner, repo, ref string, status RepoStatus)

Source from the content-addressed store, hash-verified

76//
77//meta:operation POST /repos/{owner}/{repo}/statuses/{sha}
78func (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status RepoStatus) (*RepoStatus, *Response, error) {
79 u := fmt.Sprintf("repos/%v/%v/statuses/%v", owner, repo, refURLEscape(ref))
80 req, err := s.client.NewRequest(ctx, "POST", u, &status)
81 if err != nil {
82 return nil, nil, err
83 }
84
85 var repoStatus *RepoStatus
86 resp, err := s.client.Do(req, &repoStatus)
87 if err != nil {
88 return nil, resp, err
89 }
90
91 return repoStatus, resp, nil
92}
93
94// CombinedStatus represents the combined status of a repository at a particular reference.
95type CombinedStatus struct {

Calls 3

refURLEscapeFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45