Skip to content

Commit 9ec5b5c

Browse files
committed
release: resolve next *untagged* patch version
The stable-phase version resolver did a single patch bump from VersionPrefix (1.0.0 -> 1.0.1), so every release after the first collided: the 1.0.2 release attempt re-resolved 1.0.1 and PSGallery rejected it (409, already exists). Loop the patch bump until the candidate tag is free. Verified locally: with v1.0.0 and v1.0.1 present, resolves 1.0.2.
1 parent a47b8dc commit 9ec5b5c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ jobs:
122122
$full = "$prefix-$pre"
123123
}
124124
else {
125-
# Stable phase: bump patch if this exact version was already tagged.
125+
# Stable phase: start at the prefix and bump the patch until we find
126+
# a version that isn't already tagged (so successive releases off the
127+
# same VersionPrefix don't collide with an already-published patch).
126128
$base = $prefix; $pre = ''
127-
if (git tag --list "v$prefix") {
128-
$p = $prefix -split '\.'
129+
while (git tag --list "v$base") {
130+
$p = $base -split '\.'
129131
$p[2] = [string]([int]$p[2] + 1)
130132
$base = $p -join '.'
131133
}

0 commit comments

Comments
 (0)