Skip to content

Commit 31fedec

Browse files
committed
Guard log file read with Test-Path in signing action
If msiexec fails before creating the log file, the unguarded Get-Content call throws a secondary error that obscures the real failure message.
1 parent 00a68f3 commit 31fedec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/actions/sign-files/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ runs:
7171
$process = Start-Process msiexec -ArgumentList '/i', 'smtools-windows-x64.msi', '/quiet', '/qn', '/log', 'smtools-windows-x64.log' -Wait -PassThru
7272
if ($process.ExitCode -ne 0) {
7373
Write-Output "::error title=Install Error::msiexec failed with exit code $($process.ExitCode)"
74-
Get-Content smtools-windows-x64.log -Tail 50
74+
if (Test-Path smtools-windows-x64.log) { Get-Content smtools-windows-x64.log -Tail 50 }
7575
exit 1
7676
}
7777
# Verify smctl is actually on disk before declaring success

0 commit comments

Comments
 (0)