Skip to content

Commit 9f45eea

Browse files
committed
ci fix for regex
1 parent d689d1a commit 9f45eea

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/ci_release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,22 @@ jobs:
170170
shell: pwsh
171171
run: |
172172
if (-not $env:ALIAS) { throw "ALIAS secret is empty. It must point to the PrivateKeyEntry alias." }
173-
# Ask keytool for JUST this alias to avoid secret-masking & parsing issues
173+
174174
$out = & "${env:JAVA_HOME}\bin\keytool.exe" -list -v `
175175
-keystore "$PWD\signing.jks" `
176176
-storepass $env:JKS_PASS `
177-
-alias $env:ALIAS 2>&1
177+
-alias "$env:ALIAS" 2>&1
178178
179179
if ($LASTEXITCODE -ne 0) {
180-
Write-Host $out
181-
throw "Alias '$($env:ALIAS)' not found in keystore (or wrong store password)."
180+
$out | Write-Host
181+
throw "Alias '$($env:ALIAS)' not found in keystore (or wrong store password)."
182182
}
183-
184-
# Print a small excerpt for debugging
185-
($out -split "`n") | Select-String -Pattern 'Alias name:|Entry type:|Certificate chain length' | ForEach-Object { $_.Line } | Write-Host
186-
187-
if ($out -notmatch 'Entry type:\s*PrivateKeyEntry') {
188-
throw "Alias '$($env:ALIAS)' is not a PrivateKeyEntry (likely a trustedCertEntry)."
183+
# Show a small excerpt (masking may hide values; that’s fine)
184+
$out | Select-String -Pattern 'Alias name:|Entry type:|Certificate chain length' | ForEach-Object { $_.Line } | Write-Host
185+
# IMPORTANT: treat output as ONE string before regex testing
186+
$outText = ($out | Out-String)
187+
if ($outText -notmatch 'Entry type:\s*PrivateKeyEntry') {
188+
throw "Alias '$($env:ALIAS)' is not a PrivateKeyEntry (likely a trustedCertEntry)."
189189
}
190190
191191
- name: Convert JKS to PFX

0 commit comments

Comments
 (0)