Use assets browser download url if it exists over archive tag name
This commit is contained in:
parent
b52935229e
commit
8dc7bfbb85
|
@ -77,11 +77,20 @@ const getLatestReleaseZipUrl = async (
|
|||
}
|
||||
} );
|
||||
} else if ( authorizationToken ) {
|
||||
// If it's a private repo, we need to download the archive this way
|
||||
const tagName = body.tag_name;
|
||||
resolve(
|
||||
`https://github.com/${ repository }/archive/${ tagName }.zip`
|
||||
);
|
||||
// If it's a private repo, we need to download the archive this way.
|
||||
// Use uploaded assets over downloading the zip archive.
|
||||
if (
|
||||
body.assets &&
|
||||
body.assets.length > 0 &&
|
||||
body.assets[ 0 ].browser_download_url
|
||||
) {
|
||||
resolve( body.assets[ 0 ].browser_download_url );
|
||||
} else {
|
||||
const tagName = body.tag_name;
|
||||
resolve(
|
||||
`https://github.com/${ repository }/archive/${ tagName }.zip`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
resolve( body.assets[ 0 ].browser_download_url );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue