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 ) {
|
} else if ( authorizationToken ) {
|
||||||
// If it's a private repo, we need to download the archive this way
|
// If it's a private repo, we need to download the archive this way.
|
||||||
const tagName = body.tag_name;
|
// Use uploaded assets over downloading the zip archive.
|
||||||
resolve(
|
if (
|
||||||
`https://github.com/${ repository }/archive/${ tagName }.zip`
|
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 {
|
} else {
|
||||||
resolve( body.assets[ 0 ].browser_download_url );
|
resolve( body.assets[ 0 ].browser_download_url );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue