mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 00:18:25 +00:00
fix: prevent empty releases in sdk release script
This commit is contained in:
parent
a8b9d75b2a
commit
d6fc2806dc
1 changed files with 14 additions and 0 deletions
|
|
@ -280,6 +280,20 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
continue;
|
||||
}
|
||||
|
||||
// Check if the latest commit on the target branch already has a release
|
||||
$latestCommitCommand = 'gh api repos/' . $repoName . '/commits/' . $releaseTarget . ' --jq ".sha" 2>/dev/null';
|
||||
$latestCommitSha = trim(\shell_exec($latestCommitCommand) ?? '');
|
||||
|
||||
if (!empty($latestCommitSha)) {
|
||||
$commitReleasesCommand = 'gh api repos/' . $repoName . '/releases --jq ".[] | select(.target_commitish == \"' . $releaseTarget . '\") | .tag_name" 2>/dev/null | head -n 1';
|
||||
$existingCommitRelease = trim(\shell_exec($commitReleasesCommand) ?? '');
|
||||
|
||||
if (!empty($existingCommitRelease)) {
|
||||
Console::warning("Latest commit on {$releaseTarget} already has a release ({$existingCommitRelease}) for {$language['name']} SDK, skipping to avoid empty release...");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$previousVersion = '';
|
||||
$tagListCommand = 'gh release list --repo "' . $repoName . '" --limit 1 --json tagName --jq ".[0].tagName" 2>&1';
|
||||
$previousVersion = trim(\shell_exec($tagListCommand) ?? '');
|
||||
|
|
|
|||
Loading…
Reference in a new issue