Skip to content
New issue

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

GitHub releases and redirects #468

Open
sbaildon opened this issue Nov 14, 2023 · 1 comment
Open

GitHub releases and redirects #468

sbaildon opened this issue Nov 14, 2023 · 1 comment

Comments

@sbaildon
Copy link

sbaildon commented Nov 14, 2023

Expectation: go-getter successfully downloads and extracts .gz files from GitHub releases

$ go-getter "https://github.com/arp242/goatcounter/releases/download/v2.4.1/goatcounter-v2.4.1-linux-arm64.gz?checksum=sha256:3d5cf211df640d385c1a47e7885428d2313d772501f0e9cbea06748d3cf
c36c5" goatcounter
2023/11/14 12:17:05 Error downloading: gzip-compressed files can only unarchive to a single file

The resource isn't located on github.com, instead there's a redirect happening which we can find with wget

$ wget 'https://github.com/arp242/goatcounter/releases/download/v2.4.1/goatcounter-v2.4.1-linux-arm64.gz'
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com...

and then go-getter on the redirect

$ go-getter "https://objects.githubusercontent.com/...." goatcounter
2023/11/14 12:15:12 success!
@skoenig
Copy link

skoenig commented Jun 1, 2024

Same issue here with go-getter release 1.7.4:

$ go-getter https://github.com/k3d-io/k3d/releases/download/v5.6.3/k3d-linux-amd64?checksum=file:https://github.com/k3d-io/k3d/releases/download/v5.6.3/checksums.txt k3d
2024/06/01 21:26:18 Error downloading: invalid checksum: no checksum found in: https://github.com/k3d-io/k3d/releases/download/v5.6.3/checksums.txt

https://github.com/k3d-io/k3d/releases/download/v5.6.3/checksums.txt is the correct URL for the checksum file of this project, but is redirected to some other location (https://objects.githubusercontent.com/) and go-getter can't handle that.
On the the other hand, actually downloading the binary is working just fine, despinte also being at a 302ed location:

$ go-getter https://github.com/k3d-io/k3d/releases/download/v5.6.3/k3d-linux-amd64 k3d
2024/06/01 21:28:59 success!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants