Fix version extraction to fallback on repository name if tag name is absent

This commit is contained in:
crazywhalecc 2026-03-06 16:32:44 +08:00
parent 84f6dab882
commit 32b7fee8d8
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -42,12 +42,12 @@ class GitHubTarball implements DownloadTypeInterface, CheckUpdateInterface
}
if ($match_url === null) {
$url = $rel['tarball_url'] ?? null;
$version = $rel['tag_name'] ?? null;
$version = $rel['tag_name'] ?? $rel['name'] ?? null;
break;
}
if (preg_match("|{$match_url}|", $rel['tarball_url'] ?? '')) {
$url = $rel['tarball_url'];
$version = $rel['tag_name'] ?? null;
$version = $rel['tag_name'] ?? $rel['name'] ?? null;
break;
}
}