fix: do not get releases.json if version is specific (#502)

closes #489
This commit is contained in:
Carlos Alexandro Becker 2025-08-02 05:24:12 -03:00 committed by GitHub
parent a386515f0c
commit 9a6cd01b33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 2 deletions

View file

@ -19,6 +19,21 @@ export const getReleaseTag = async (distribution: string, version: string): Prom
if (version === 'nightly') {
return {tag_name: version};
}
// If version is a specific version (not a range), skip the JSON check
const cleanVersion: string = cleanTag(version);
if (semver.valid(cleanVersion)) {
let tag = version.startsWith('v') ? version : `v${version}`;
// Handle GoReleaser Pro suffix for versions < 2.7.0, but only if not already present
// TODO: remove all this `-pro` thing at some point.
if (goreleaser.isPro(distribution) && semver.lt(cleanVersion, '2.7.0') && !tag.endsWith('-pro')) {
tag = tag + goreleaser.distribSuffix(distribution);
}
return {tag_name: tag};
}
const tag: string = (await resolveVersion(distribution, version)) || version;
const suffix: string = goreleaser.distribSuffix(distribution);
const url = `https://goreleaser.com/static/releases${suffix}.json`;