DownloadArtifact gets a redirect URL to download an archive for a repository. GitHub API docs: https://docs.github.com/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int)
| 159 | // |
| 160 | //meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format} |
| 161 | func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) { |
| 162 | u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) |
| 163 | |
| 164 | if s.client.rateLimitRedirectionalEndpoints { |
| 165 | return s.downloadArtifactWithRateLimit(ctx, u, maxRedirects) |
| 166 | } |
| 167 | |
| 168 | return s.downloadArtifactWithoutRateLimit(ctx, u, maxRedirects) |
| 169 | } |
| 170 | |
| 171 | func (s *ActionsService) downloadArtifactWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) { |
| 172 | resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects) |