git-updater: Release Assets for private repo: Missing Access Token?
Hi,
I tried using the âRelease Assetsâ feature with a private repo. From the plugin update screen I can see itâs trying to fetch the correct file.
https://github.com/myprivateorg/myprivate/releases/download/v0.1.3/myplugin-v0.1.3.zip
But it 404 fails. When I copy the URL to my browser, I can access and download it. Is it possible that the configured access token is not used here?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 20 (12 by maintainers)
Hereâs the answer from GitHub
That didnât really help but I found a solution diving into the API again:
Assuming we already know the tag name (which is the case in Github Updater), we can access the release directly like this:
Which returns
There can be multiple assets. You could apply the already defined naming scheme and filter, or simply take the first asset.
Now, the
browser_download_url
is the one we already know doesnât work except in the browser (as the name suggests đ).However, I found this in the API docs:
This worksâheureka! đĄ
-L
: Itâs important to follow the location because the actual file is hosted on S3.-H "Accept: application/octet-stream"
: the header that tells GitHub to download rather than return a JSON response-H "Authorization: token XXXXX"
, I got a Bad Request response from Amazon.Itâs probably a fair bit of work to implement but the approach should work. Until then you should add to the readme that asset downloading does not work for private repos for now.
Gave it a try with 6.0.0.16 and it worked đ
I think youâre going to like this.
Still cleaning up and working out the kinks.