@@ -143,6 +143,39 @@ Describe 'CompareVI.Tools artifact publishing' {
143143 @ ($archiveMetadata.bundle.files.path ) | Should - Contain ' tools/Compare-ExitCodeClassifier.ps1'
144144 }
145145
146+ It ' emits an empty prerelease GitHub output for stable CompareVI.Tools bundles' {
147+ $outDir = Join-Path $TestDrive ' artifacts-github-output'
148+ $metadataPath = Join-Path $TestDrive ' comparevi-tools-artifact-github-output.json'
149+ $githubOutputPath = Join-Path $TestDrive ' github-output.txt'
150+
151+ $originalGitHubOutput = $env: GITHUB_OUTPUT
152+ try {
153+ $env: GITHUB_OUTPUT = $githubOutputPath
154+
155+ & $publishScript `
156+ - OutputRoot $outDir `
157+ - MetadataReportPath $metadataPath `
158+ - Repository ' owner/repo' `
159+ - SourceRef ' refs/tags/v9.9.9' `
160+ - SourceSha ' 0123456789abcdef0123456789abcdef01234567' `
161+ - ReleaseTag ' v9.9.9' `
162+ - EmitGitHubOutputs
163+ } finally {
164+ if ($null -ne $originalGitHubOutput ) {
165+ $env: GITHUB_OUTPUT = $originalGitHubOutput
166+ } else {
167+ Remove-Item Env:GITHUB_OUTPUT - ErrorAction SilentlyContinue
168+ }
169+ }
170+
171+ Test-Path - LiteralPath $githubOutputPath | Should - BeTrue
172+ $outputLines = Get-Content - LiteralPath $githubOutputPath
173+ $outputLines | Should - Contain " comparevi_tools_module_version=$moduleVersion "
174+ $outputLines | Should - Contain " comparevi_tools_release_version=$moduleReleaseVersion "
175+ $outputLines | Should - Contain ' comparevi_tools_module_prerelease='
176+ ($outputLines | Where-Object { $_ -like ' comparevi_tools_module_prerelease=*' }).Count | Should - Be 1
177+ }
178+
146179 It ' exports the bundle root through COMPAREVI_SCRIPTS_ROOT when invoking the module wrapper' {
147180 $bundleRoot = Join-Path $TestDrive ' bundle'
148181 $moduleRoot = Join-Path $bundleRoot ' tools' ' CompareVI.Tools'
0 commit comments