@@ -33,11 +33,25 @@ jobs:
3333 with :
3434 SettingsPath : ' ./tests/scenarios/valid/PSModule.yml'
3535
36- - name : Validate Settings Output
36+ - name : Verify Action Succeeded
3737 shell : pwsh
3838 env :
3939 SETTINGS_JSON : ${{ steps.get-settings.outputs.Settings }}
40- run : ./tests/Validate-Settings.ps1
40+ run : |
41+ if ([string]::IsNullOrEmpty($env:SETTINGS_JSON)) {
42+ Write-Error 'Action failed to produce settings output'
43+ exit 1
44+ }
45+ Write-Host '✓ Action executed successfully and produced valid output'
46+
47+ # Verify the output is valid JSON
48+ try {
49+ $settings = $env:SETTINGS_JSON | ConvertFrom-Json
50+ Write-Host "✓ Settings output is valid JSON with Name: $($settings.Name)"
51+ } catch {
52+ Write-Error "Settings output is not valid JSON: $_"
53+ exit 1
54+ }
4155
4256 ActionTestInvalidMissingTestConfig :
4357 name : Action-Test - [Invalid - Missing Test Config]
@@ -49,21 +63,18 @@ jobs:
4963 with :
5064 persist-credentials : false
5165
52- - name : Action-Test
66+ - name : Action-Test (Expect Failure)
5367 id : get-settings
68+ continue-on-error : true
5469 uses : ./
5570 with :
5671 SettingsPath : ' ./tests/scenarios/invalid-missing-test-config/PSModule.yml'
5772
58- - name : Validate Settings Output (Expect Failure)
73+ - name : Verify Action Failed as Expected
5974 shell : pwsh
60- env :
61- SETTINGS_JSON : ${{ steps.get-settings.outputs.Settings }}
6275 run : |
63- $ErrorActionPreference = 'Continue'
64- ./tests/Validate-Settings.ps1
65- if ($LASTEXITCODE -eq 0) {
66- Write-Error 'Expected validation to fail for invalid configuration, but it succeeded'
76+ if ('${{ steps.get-settings.outcome }}' -eq 'success') {
77+ Write-Error 'Expected action to fail for invalid configuration, but it succeeded'
6778 exit 1
6879 }
69- Write-Host '✓ Validation failed as expected for invalid configuration'
80+ Write-Host '✓ Action failed as expected for invalid configuration'
0 commit comments