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

Method downloadArtifactWithRateLimit

github/actions_artifacts.go:190–208  ·  view source on GitHub ↗
(ctx context.Context, u string, maxRedirects int)

Source from the content-addressed store, hash-verified

188}
189
190func (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {
191 req, err := s.client.NewRequest(ctx, "GET", u, nil)
192 if err != nil {
193 return nil, nil, err
194 }
195
196 url, resp, err := s.client.bareDoUntilFound(req, maxRedirects)
197 if err != nil {
198 return nil, resp, err
199 }
200 defer resp.Body.Close()
201
202 // If we didn't receive a valid Location in a 302 response
203 if url == nil {
204 return nil, resp, fmt.Errorf("unexpected status code: %v", resp.Status)
205 }
206
207 return url, resp, nil
208}
209
210// DeleteArtifact deletes a workflow run artifact.
211//

Callers 1

DownloadArtifactMethod · 0.95

Calls 3

NewRequestMethod · 0.80
bareDoUntilFoundMethod · 0.80
CloseMethod · 0.80

Tested by

no test coverage detected