marwanhawari / stew

🥘 An independent package manager for compiled binaries.
MIT License
193 stars 14 forks source link

Unable to download artifact from private repo #23

Closed shopeonarope closed 1 year ago

shopeonarope commented 1 year ago

First off love the tool. Thanks for your work.

I export my GITHUB_TOKEN and when I try to directly run stew install private-org/repo I get the spinner then:

Error: Received non-zero status code from HTTP request when attempting to download a file: 404

stew search private-org/repo pulls up everything I'd expect; I select my repo and select the artifact version but then I get the same error as above.

With my limited golang-fu I added GODEBUG=http2debug=2 to get some more feedback about what was happening. When running the same search as before I could see the http authorization header on the /search and /releases requests. However when it came to the /releases/download request there was no such header. And spelunking through the code I see that Install() calls DownloadFile() which just does a bare http.Get, if I'm not mistaken.

marwanhawari commented 1 year ago

Hey thanks for reporting this! I wonder why I didn't run into this during development. It sounds like you have and idea on how to fix this - do you think you could make a PR?

shopeonarope commented 1 year ago

@marwanhawari this can be closed as it was address in https://github.com/marwanhawari/stew/pull/24. Also can you cut a new release that includes that change? Thanks!