Skip to content

Commit 362a1f5

Browse files
committed
Improve launcher validation outputs
1 parent 52c5fe2 commit 362a1f5

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

ci/scripts/validateLauncher.ps1

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
$launcherName="output\nvda*.exe"
22
if (-not (Test-Path -Path $launcherName -PathType Leaf)) {
3-
Write-Output "The launcher does not exist." >> $env:GITHUB_STEP_SUMMARY
3+
Write-Output "FAIL: Launcher verification. The launcher does not exist." >> $env:GITHUB_STEP_SUMMARY
44
exit 1
55
}
6-
if ($env:apiSigningToken -and (Get-AuthenticodeSignature -FilePath $launcherName).Status -ne 'Valid') {
7-
Write-Output "The launcher was not signed, or the signature was invalid.`n">> $env:GITHUB_STEP_SUMMARY
8-
exit 1
6+
if ($env:apiSigningToken) {
7+
$authenticodeSignature = Get-AuthenticodeSignature -FilePath $launcherName
8+
if (($authenticodeSignature).Status -ne 'Valid') {
9+
Set-PSRepository PSGallery -InstallationPolicy Trusted
10+
Install-Module -Name FormatMarkdownTable -Force
11+
Write-Output @"
12+
FAIL: Launcher validation. Expected the launcher to be signed.
13+
<details>
14+
<summary>Signature details</summary>
15+
16+
$($authenticodeSignature | Format-MarkdownTableTableStyle -HideStandardOutput -ShowMarkdown -DoNotCopyToClipboard)
17+
18+
</details>
19+
"@ >> $env:GITHUB_STEP_SUMMARY
20+
exit 1
21+
}
922
}

0 commit comments

Comments
 (0)