fix(versioning): wrong next version if repo only has prereleases

This commit is contained in:
Julian Tölle 2024-08-03 01:16:58 +02:00
parent 9444ea9915
commit 05084aa484
2 changed files with 48 additions and 1 deletions

View file

@ -24,7 +24,12 @@ func (r Releases) NextVersion(versionBump conventionalcommits.VersionBump, nextV
return "", fmt.Errorf("failed to parse stable version: %w", err)
}
next := stable // Copy all fields
// If there is a previous stable release, we use that as the version anchor. Falling back to any pre-releases
// if they are the only tags in the repo.
next := latest
if r.Stable != nil {
next = stable
}
switch versionBump {
case conventionalcommits.UnknownVersion: