Check for more filename variants when downloading release zip
[MAILPOET-3482]
This commit is contained in:
committed by
Veljko V
parent
e02980e0f9
commit
c55d4f06be
@@ -28,10 +28,15 @@ class GithubClient {
|
|||||||
if (!$release) {
|
if (!$release) {
|
||||||
throw new \Exception("Release $tag not found");
|
throw new \Exception("Release $tag not found");
|
||||||
}
|
}
|
||||||
|
$namesToCheck = [
|
||||||
|
$zip,
|
||||||
|
str_replace('.zip', ".$tag.zip", $zip),
|
||||||
|
str_replace('.zip', "-$tag.zip", $zip),
|
||||||
|
];
|
||||||
$assetDownloadUrl = null;
|
$assetDownloadUrl = null;
|
||||||
$assetDownloadInfo = null;
|
$assetDownloadInfo = null;
|
||||||
foreach ($release['assets'] as $asset) {
|
foreach ($release['assets'] as $asset) {
|
||||||
if ($asset['name'] === $zip) {
|
if (in_array($asset['name'], $namesToCheck, true)) {
|
||||||
$assetDownloadUrl = $asset['url'];
|
$assetDownloadUrl = $asset['url'];
|
||||||
$assetDownloadInfo = $asset['browser_download_url'];
|
$assetDownloadInfo = $asset['browser_download_url'];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user