(ctx context.Context, u string, maxRedirects int)
| 188 | } |
| 189 | |
| 190 | func (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 | // |
no test coverage detected