We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func downloadReleaseAssetFromURL(ctx context.Context, url string) (rc io.ReadCloser, err error) { client := http.DefaultClient req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return nil, err } req = req.WithContext(ctx) req.Header.Set("Accept", "*/*") req.Header.Set("Authorization", "Bearer $TOKEN") req.Header.Set("X-GitHub-Api-Version", "2022-11-28") resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("failed to download a release file from %s: %w", url, err) } if resp.StatusCode >= 300 { resp.Body.Close() return nil, fmt.Errorf("failed to download a release file from %s: HTTP %d", url, resp.StatusCode) } return resp.Body, nil }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: