File tree Expand file tree Collapse file tree
.github/actions/Publish-PSModule Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -518,7 +518,7 @@ function Get-PSModulePublicationState {
518518 if ($release.draft -isnot [bool ] -or $release.draft -ne $false ) {
519519 throw ' The existing release has no verified boolean draft:false status. Refusing publication or an incomplete release.'
520520 }
521- if ($release.tag_name -cne $expected.ReleaseTag -or
521+ if ($release.tag_name -isnot [ string ] -or $release .tag_name - cne $expected.ReleaseTag -or
522522 [string ]::IsNullOrWhiteSpace($release.html_url ) -or
523523 $release.prerelease -isnot [bool ] -or
524524 $release.prerelease -ne ($expected.ReleaseType -ceq ' Prerelease' ) -or
Original file line number Diff line number Diff line change @@ -261,6 +261,27 @@ Describe 'Publish-PSModule source-bound preflight' {
261261 @ (& $reader.GetTagList ).Count | Should - Be 0
262262 }
263263
264+ It ' rejects an array-valued release tag before <Controller> writes' - ForEach @ (
265+ @ { Controller = ' publisher' }
266+ @ { Controller = ' release' }
267+ ) {
268+ Set-PSModuleFixtureClaim - State $script :state - Claim $script :state.ExpectedClaim
269+ $script :state.Release = [pscustomobject ]@ {
270+ id = 10 ; tag_name = @ (' v1.2.4' ); html_url = ' https://github.com/PSModule/TestModule/releases/tag/v1.2.4'
271+ prerelease = $false ; draft = $false ; body = ' Direct release notes.' ; assets = @ ()
272+ }
273+ $controllerPath = $script :publishScriptPath
274+ if ($Controller -ceq ' release' ) { $controllerPath = $script :releaseScriptPath }
275+ $failure = $null
276+
277+ try { & $controllerPath 1> $null 6> $null } catch { $failure = $_ }
278+
279+ $script :state.GalleryWrites | Should - Be 0
280+ $script :state.GitHubWrites | Should - Be 0
281+ $failure | Should -Not - BeNullOrEmpty
282+ $failure.Exception.Message | Should -Match ' existing release context'
283+ }
284+
264285 It ' rejects a Gallery-only package with no source and artifact proof' {
265286 $script :state.Package = [pscustomobject ]@ { Name = ' TestModule' ; Version = ' 1.2.4' }
266287
You can’t perform that action at this time.
0 commit comments