Skip to content

Commit 8025201

Browse files
🪲 [Fix]: Fix an issue with padding the prerelease number (#42)
## Description This pull request includes a small change to the `Publish-PSModule` function in the `scripts/helpers/Publish-PSModule.ps1` file. The change modifies the way the `latestPrereleaseNumber` is padded with zeros. * [`scripts/helpers/Publish-PSModule.ps1`](diffhunk://#diff-780715ac24c6bbe21b54f3d268778136b79f21a62275bbd494dfa857b4ba40d9L278-R278): Changed the `latestPrereleaseNumber` variable to be explicitly cast to a string before padding it with zeros. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 77cedbc commit 8025201

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/helpers/Publish-PSModule.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function Publish-PSModule {
275275

276276
$latestPrereleaseNumber = [Math]::Max($latestPSGalleryPrerelease, $latestGHPrereleases)
277277
$latestPrereleaseNumber++
278-
$latestPrereleaseNumber = $latestPrereleaseNumber.PadLeft(3,'0')
278+
$latestPrereleaseNumber = ([string]$latestPrereleaseNumber).PadLeft(3, '0')
279279
$newVersion.Prerelease += $latestPrereleaseNumber
280280
}
281281
}

0 commit comments

Comments
 (0)