File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -295,13 +295,15 @@ export const grabReleaseFileFromRepository = async (
295
295
Accept : "application/octet-stream" ,
296
296
} ;
297
297
298
- // Authenticated requests get a higher rate limit
299
- if ( ( isPrivate && personalAccessToken ) || personalAccessToken ) {
298
+ // Authenticated requests get a higher rate limit, only needed for private repositories here
299
+ if ( isPrivate && personalAccessToken ) {
300
300
headers . Authorization = `Token ${ personalAccessToken } ` ;
301
301
}
302
302
303
+ // Download from the asset URL if it's a private repo, otherwise use the browser download URL
304
+ const downloadUrl = isPrivate ? asset . url : asset . browser_download_url ;
303
305
const download = await request ( {
304
- url : asset . url ,
306
+ url : downloadUrl ,
305
307
headers,
306
308
} ) ;
307
309
return download === "Not Found" || download === `{"error":"Not Found"}` ? null : download ;
You can’t perform that action at this time.
0 commit comments