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

Method DownloadArtifact

github/actions_artifacts.go:161–169  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

159//
160//meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
161func (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
171func (s *ActionsService) downloadArtifactWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {
172 resp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects)