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

[runx] Add support for fetching private GitHub release assets #368

Merged

Conversation

mikael-lindstrom
Copy link
Contributor

Summary

Allows runx to download release assets from private repositories, fixes jetify-com/devbox#2223

  • Adds a constructor for download to set the GitHub token
  • Switches to use the api url instead of browser url when downloading assets
  • Sets Accept header to application/octet-stream to get the binary instead of json metadata for the asset

How was it tested?

I have tested the runx cli locally with and without RUNX_GITHUB_API_TOKEN set. With the environment variable the release asset is downloaded correctly from private repositories. Without the environment variable public repositories works fine and private returns 404.

I also build devbox locally and tested with and without DEVBOX_GITHUB_API_TOKEN set and it works the same as running the runx cli directly.

Copy link
Contributor

@savil savil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I also did a rudimentary test by pointing Devbox repo to this PR's changes for runx, and it seemed to work fine.

@loreto @mikeland73 @LucilleH @gcurtis I have limited experience with runx code so tagging you to take a second look. I'll merge this in a short while.

@LucilleH
Copy link
Contributor

Looks good to me on the github part 👍

@savil savil merged commit 2b3f465 into jetify-com:main Aug 15, 2024
1 check passed
@savil
Copy link
Contributor

savil commented Aug 15, 2024

@mikael-lindstrom thank you!

@mikael-lindstrom mikael-lindstrom deleted the runx-private-gh-release-support branch August 15, 2024 06:59
mikeland73 added a commit to jetify-com/devbox that referenced this pull request Aug 15, 2024
## Summary

Uses newest version of runx
(jetify-com/opensource#368)

cc: @mikael-lindstrom

## How was it tested?

```
rm -rf ~/Library/Caches/runx/pkgs/mvdan
devbox run fmt  # which requires mvdan/gofumpt
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add support for fetching private binaries in GitHub
3 participants