File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,30 @@ jobs:
3030 $cert | Export-Certificate -FilePath cert.cer -Type CERT
3131 Write-Host "Certificate exported to cert.cer"
3232
33+ # Store thumbprint for next step
34+ $cert.Thumbprint | Out-File -FilePath cert_thumbprint.txt
35+ Write-Host "Thumbprint saved to cert_thumbprint.txt"
36+
3337 - name : Sign PowerShell script
3438 shell : powershell
3539 run : |
3640 Write-Host "Signing setup_venv.ps1..."
37- $cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1
41+ $thumbprint = Get-Content cert_thumbprint.txt
42+ Write-Host "Using certificate thumbprint: $thumbprint"
43+
44+ $cert = Get-ChildItem Cert:\CurrentUser\My\$thumbprint
3845 if (-not $cert) {
39- throw "No code signing certificate found"
46+ Write-Host "Certificate not found. Available certificates:"
47+ Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.HasPrivateKey } | Format-Table Subject, Thumbprint
48+ throw "Code signing certificate not found"
4049 }
4150
42- Set-AuthenticodeSignature -FilePath "setup_venv.ps1" -Certificate $cert
51+ Write-Host "Using certificate: $($cert.Subject)"
52+ $result = Set-AuthenticodeSignature -FilePath "setup_venv.ps1" -Certificate $cert
53+ Write-Host "Signature result: $($result.Status)"
54+ if ($result.Status -ne "Valid") {
55+ throw "Failed to sign script: $($result.StatusMessage)"
56+ }
4357 Write-Host "Script signed successfully"
4458
4559 - name : Verify signature
You can’t perform that action at this time.
0 commit comments