Skip to content

Commit 82d6969

Browse files
fix: correct ModulePath in prerelease/unstamped tests, add placeholder version, fix ZIZMOR injection
1 parent ff56835 commit 82d6969

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/Action-Test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
GITHUB_TOKEN: ${{ github.token }}
9393
with:
9494
Name: PSModuleTest
95-
ModulePath: outputs/module
95+
ModulePath: outputs/module-prerelease
9696
WorkingDirectory: tests
9797
APIKey: ${{ secrets.APIKEY }} # zizmor: ignore[secrets-outside-env] saved in org secrets as an intentional choice
9898
WhatIf: true
@@ -153,13 +153,15 @@ jobs:
153153
GITHUB_TOKEN: ${{ github.token }}
154154
with:
155155
Name: PSModuleTest
156-
ModulePath: outputs/module
156+
ModulePath: outputs/module-unstamped
157157
WorkingDirectory: tests
158158
APIKey: ${{ secrets.APIKEY }} # zizmor: ignore[secrets-outside-env] saved in org secrets as an intentional choice
159159
WhatIf: true
160160

161161
- name: Validate unstamped artifact is rejected
162162
shell: pwsh
163+
env:
164+
PUBLISH_OUTCOME: ${{ steps.publish.outcome }}
163165
run: |
164166
$manifestPath = 'tests/outputs/module-unstamped/PSModuleTest/PSModuleTest.psd1'
165167
$manifest = Import-PowerShellDataFile -Path $manifestPath
@@ -168,13 +170,13 @@ jobs:
168170
169171
Write-Host "Module version in manifest: [$version]"
170172
Write-Host "Release tag from action: [$releaseTag]"
171-
Write-Host "Publish step outcome: [${{ steps.publish.outcome }}]"
173+
Write-Host "Publish step outcome: [$env:PUBLISH_OUTCOME]"
172174
173175
if ($version -ne '999.0.0') {
174176
Write-Error "Expected placeholder version [999.0.0] but got [$version]."
175177
exit 1
176178
}
177-
if ('${{ steps.publish.outcome }}' -eq 'success') {
179+
if ($env:PUBLISH_OUTCOME -eq 'success') {
178180
Write-Error 'The publish action should have failed for an unstamped artifact but it succeeded.'
179181
exit 1
180182
}

tests/outputs/module-unstamped/PSModuleTest/PSModuleTest.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@{
22
RootModule = 'PSModuleTest.psm1'
3+
ModuleVersion = '999.0.0'
34
CompatiblePSEditions = @(
45
'Core'
56
'Desktop'

0 commit comments

Comments
 (0)