File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -517,7 +517,16 @@ jobs:
517517
518518 Write-Host "Client cert in store: $($importedCert.Subject)"
519519 Write-Host "Client cert thumbprint: $($importedCert.Thumbprint)"
520- Add-Content -Path $env:GITHUB_ENV -Value "CLIENT_CERT_SUBJECT=$($importedCert.Subject)"
520+ # Extract CN from the subject for use as a cert store search string.
521+ # The full X.500 DN contains commas which break command-line argument
522+ # parsing, but CertFindCertificateInStore does substring matching so
523+ # the CN alone is sufficient.
524+ $cn = $importedCert.Subject
525+ if ($cn -match 'CN=([^,]+)') {
526+ $cn = $matches[1].Trim()
527+ }
528+ Write-Host "Client cert CN for store lookup: '$cn'"
529+ Add-Content -Path $env:GITHUB_ENV -Value "CLIENT_CERT_SUBJECT=$cn"
521530 } else {
522531 # For file/x509: create a placeholder cert (not used, but keeps env var consistent)
523532 $clientCert = New-SelfSignedCertificate `
You can’t perform that action at this time.
0 commit comments