@@ -120,25 +120,23 @@ function Test-GithubAttestation {
120
120
[string ]$RepoName
121
121
)
122
122
123
- Write-Host " 🔐 Verifying attestation for: $FilePath " - ForegroundColor Gray
123
+ # Get the parent directory name and the file name
124
+ $fileName = (Get-ChildItem $FilePath ).Name
125
+
126
+ Write-Host " 🔐 Verifying attestation for: ..$parentDir \$fileName " - ForegroundColor Gray
124
127
125
128
try {
126
- # Check if gh CLI is available
127
- if (-not (Get-Command gh - ErrorAction SilentlyContinue)) {
128
- throw " GitHub CLI (gh) is not installed or not in PATH"
129
- }
130
-
131
129
$output = gh attestation verify $FilePath -- repo $RepoName 2>&1
132
130
if ($LASTEXITCODE -ne 0 ) {
133
131
Write-Host $output - ForegroundColor Red
134
132
throw $output # This will trigger the catch block
135
133
}
136
134
137
- Write-Host " ✅ Attestation verified " - ForegroundColor Green
135
+ Write-Host " ✅ Verified " - ForegroundColor Green
138
136
return $true
139
137
}
140
138
catch {
141
- Write-Host " ❌ Attestation verification failed: $_ " - ForegroundColor Red
139
+ Write-Host " ❌ Verification failed: $_ " - ForegroundColor Red
142
140
return $false
143
141
}
144
142
}
@@ -241,6 +239,11 @@ function Invoke-NuGetPackageSigning {
241
239
}
242
240
Write-Host " ✓ NuGet found at: $NuGetPath "
243
241
242
+ if (-not (Get-Command gh - ErrorAction SilentlyContinue)) {
243
+ throw " GitHub CLI installed or not found in PATH"
244
+ }
245
+ Write-Host " ✓ GitHub CLI found at: $NuGetPath "
246
+
244
247
# Verify certificate is available and log details
245
248
$cert = Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -eq $Thumbprint }
246
249
if (-not $cert ) {
@@ -318,11 +321,16 @@ function Invoke-NuGetPackageSigning {
318
321
Sign- SingleFile - FilePath $dll.FullName - Thumbprint $Thumbprint - SignToolPath $SignToolPath - TimestampServer $TimestampServer
319
322
}
320
323
321
- Write-Host " Repacking signed content ..."
324
+ Write-Host " Repacking assemblies ..."
322
325
Get-ChildItem - Path $extractPath - Recurse - Filter " *.nuspec" |
323
326
ForEach-Object {
324
327
Write-Host " Packing: $ ( $_.Name ) "
325
- & $NuGetPath pack $_.FullName - OutputDirectory $directories.Packages
328
+ $output = & $NuGetPath pack $_.FullName - OutputDirectory $directories.Packages 2>&1
329
+
330
+ if ($LASTEXITCODE -ne 0 ) {
331
+ $output | ForEach-Object { Write-Host $_ }
332
+ throw " Signing failed for file: $FilePath "
333
+ }
326
334
}
327
335
}
328
336
@@ -345,7 +353,13 @@ function Invoke-NuGetPackageSigning {
345
353
" -Timestamper" , $TimestampServer ,
346
354
" -NonInteractive"
347
355
)
348
- & $NuGetPath @nugetSignParams
356
+
357
+ $output = & $NuGetPath @nugetSignParams 2>&1
358
+
359
+ if ($LASTEXITCODE -ne 0 ) {
360
+ $output | ForEach-Object { Write-Host $_ }
361
+ throw " Signing failed for file: $FilePath "
362
+ }
349
363
}
350
364
351
365
# Print summary of signed packages
0 commit comments