error check code signing

This commit is contained in:
Chris Titus 2024-08-02 19:10:09 -05:00
parent 09575b0f8d
commit 4ee41cf198

View File

@ -32,6 +32,11 @@ jobs:
$cert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1 $cert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1
if ($null -eq $cert) { throw "Code signing certificate not found" } if ($null -eq $cert) { throw "Code signing certificate not found" }
Set-AuthenticodeSignature -FilePath ./winutil.ps1 -Certificate $cert Set-AuthenticodeSignature -FilePath ./winutil.ps1 -Certificate $cert
- name: Verify code signature
shell: pwsh
run: |
$signature = Get-AuthenticodeSignature -FilePath ./winutil.ps1
if ($signature.Status -ne 'Valid') { throw "Code signing failed" }
- name: Upload winutil.ps1 as artifact - name: Upload winutil.ps1 as artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with: