File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 WorkingDirectory : tests
4242 APIKey : ${{ secrets.APIKEY }} # zizmor: ignore[secrets-outside-env] saved in org secrets as an intentional choice
4343 WhatIf : true
44+
45+ - name : Validate module version is stamped
46+ shell : pwsh
47+ run : |
48+ $manifestPath = 'tests/outputs/module/PSModuleTest/PSModuleTest.psd1'
49+ $manifest = Import-PowerShellDataFile -Path $manifestPath
50+ $version = $manifest.ModuleVersion
51+ $releaseTag = $env:PSMODULE_PUBLISH_PSMODULE_CONTEXT_ReleaseTag
52+
53+ Write-Host "Module version in manifest: [$version]"
54+ Write-Host "Release tag from action: [$releaseTag]"
55+
56+ if ($version -eq '999.0.0') {
57+ Write-Error "Module version is still the placeholder [999.0.0]. The artifact was not stamped with a real version."
58+ exit 1
59+ }
60+ if ($releaseTag -match '^999\.0\.0') {
61+ Write-Error "Release tag [$releaseTag] is based on the placeholder version. The artifact was not stamped."
62+ exit 1
63+ }
64+ Write-Host "Version validation passed: [$version] (tag: [$releaseTag])"
You can’t perform that action at this time.
0 commit comments