Download release asset from private repo using personal access token #47453
Replies: 3 comments 4 replies
-
Instead of the direct download url, have you tried Github API? Here's how you can download a certain asset in a release. (See Github API Doc) # Download a certain asset file in a release
curl -L \
-H "Accept: application/octet-stream" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
-o {destination-file-name} \
https://api.github.com/repos/{OWNER}/{REPO}/releases/assets/{ASSET-ID}
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 148k 100 148k 0 0 198k 0 --:--:-- --:--:-- --:--:-- 198k Where is the # List all the releases in a repo
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/{OWNER}/{REPO}/releases Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Anyone found away to download the content of the asset from a private repo ? Using the @pantelis-karamolegkos Did you find a solution ? |
Beta Was this translation helpful? Give feedback.
-
Zero market |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I am trying to download a release assed from GitHub using
curl
, as follows:This keep fetching a file with content
Not Found
.When opening the link
https://github.com/Org/repo/releases/download/0.4.2/repo-linux-amd64
from an authenticated browser window, it does download the file.I have also tested my
token
by runningWhat is more, the token has the right scopes given that
also works (the token value is exported in the
GITHUB_TOKEN
environment variable).I have also tried this variation (with
token
instead ofBearer
in theAuthorization
header) and the end result is the sameWhat am I missing?
Beta Was this translation helpful? Give feedback.
All reactions