Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Every exported method and type needs to have code comments that follow
//meta:operation GET /repos/{owner}/{repo}
func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) {
u := fmt.Sprintf("repos/%v/%v", owner, repo)
req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
...
}
```
Expand Down
20 changes: 10 additions & 10 deletions github/actions_artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string,
return nil, nil, err
}

req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var artifactList *ArtifactList
resp, err := s.client.Do(ctx, req, &artifactList)
resp, err := s.client.Do(req, &artifactList)
if err != nil {
return nil, resp, err
}
Expand All @@ -117,13 +117,13 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re
return nil, nil, err
}

req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var artifactList *ArtifactList
resp, err := s.client.Do(ctx, req, &artifactList)
resp, err := s.client.Do(req, &artifactList)
if err != nil {
return nil, resp, err
}
Expand All @@ -139,13 +139,13 @@ func (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, re
func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID)

req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var artifact *Artifact
resp, err := s.client.Do(ctx, req, &artifact)
resp, err := s.client.Do(req, &artifact)
if err != nil {
return nil, resp, err
}
Expand Down Expand Up @@ -188,12 +188,12 @@ func (s *ActionsService) downloadArtifactWithoutRateLimit(ctx context.Context, u
}

func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {
req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

url, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects)
url, resp, err := s.client.bareDoUntilFound(req, maxRedirects)
if err != nil {
return nil, resp, err
}
Expand All @@ -215,10 +215,10 @@ func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u st
func (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v", owner, repo, artifactID)

req, err := s.client.NewRequest("DELETE", u, nil)
req, err := s.client.NewRequest(ctx, "DELETE", u, nil)
if err != nil {
return nil, err
}

return s.client.Do(ctx, req, nil)
return s.client.Do(req, nil)
}
28 changes: 14 additions & 14 deletions github/actions_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ func (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opt
return nil, nil, err
}

req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var actionCacheList *ActionsCacheList
resp, err := s.client.Do(ctx, req, &actionCacheList)
resp, err := s.client.Do(req, &actionCacheList)
if err != nil {
return nil, resp, err
}
Expand All @@ -119,12 +119,12 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key
return nil, err
}

req, err := s.client.NewRequest("DELETE", u, nil)
req, err := s.client.NewRequest(ctx, "DELETE", u, nil)
if err != nil {
return nil, err
}

return s.client.Do(ctx, req, nil)
return s.client.Do(req, nil)
}

// DeleteCachesByID deletes a GitHub Actions cache for a repository, using a cache ID.
Expand All @@ -136,12 +136,12 @@ func (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key
//meta:operation DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}
func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/caches/%v", owner, repo, cacheID)
req, err := s.client.NewRequest("DELETE", u, nil)
req, err := s.client.NewRequest(ctx, "DELETE", u, nil)
if err != nil {
return nil, err
}

return s.client.Do(ctx, req, nil)
return s.client.Do(req, nil)
}

// GetCacheUsageForRepo gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes,
Expand All @@ -155,13 +155,13 @@ func (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo strin
//meta:operation GET /repos/{owner}/{repo}/actions/cache/usage
func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/actions/cache/usage", owner, repo)
req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var cacheUsage *ActionsCacheUsage
res, err := s.client.Do(ctx, req, &cacheUsage)
res, err := s.client.Do(req, &cacheUsage)
if err != nil {
return nil, res, err
}
Expand All @@ -185,13 +185,13 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str
return nil, nil, err
}

req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var cacheUsage *ActionsCacheUsageList
res, err := s.client.Do(ctx, req, &cacheUsage)
res, err := s.client.Do(req, &cacheUsage)
if err != nil {
return nil, res, err
}
Expand All @@ -210,13 +210,13 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str
//meta:operation GET /orgs/{org}/actions/cache/usage
func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) {
u := fmt.Sprintf("orgs/%v/actions/cache/usage", org)
req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var cacheUsage *TotalCacheUsage
res, err := s.client.Do(ctx, req, &cacheUsage)
res, err := s.client.Do(req, &cacheUsage)
if err != nil {
return nil, res, err
}
Expand All @@ -234,13 +234,13 @@ func (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org strin
//meta:operation GET /enterprises/{enterprise}/actions/cache/usage
func (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) {
u := fmt.Sprintf("enterprises/%v/actions/cache/usage", enterprise)
req, err := s.client.NewRequest("GET", u, nil)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}

var cacheUsage *TotalCacheUsage
res, err := s.client.Do(ctx, req, &cacheUsage)
res, err := s.client.Do(req, &cacheUsage)
if err != nil {
return nil, res, err
}
Expand Down
Loading
Loading