Skip to content

Commit f26d34f

Browse files
committed
Fix dry-run syntax
1 parent a4eb810 commit f26d34f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,20 @@ jobs:
100100
# For manual triggers, only publish if dry_run is explicitly set to false
101101
$isDryRun = "${{ github.event_name }}" -eq "workflow_dispatch" -and "${{ github.event.inputs.dry_run }}" -ne "false"
102102
103+
$apiKey = "${{ steps.nuget-login.outputs.NUGET_API_KEY }}"
104+
103105
if ($isDryRun) {
104106
Write-Host "Dry run mode - skipping NuGet publish"
105-
if ("${{ steps.nuget-login.outputs.NUGET_API_KEY }}" -neq "") {
107+
if ($apiKey -ne "") {
106108
Write-Host "- Has NuGet API key from login"
107109
} else {
108110
Write-Host "- WARNING: Missing NuGet API key from login"
111+
exit 1
109112
}
110113
} else {
111114
Write-Host "Publishing to NuGet..."
112115
foreach ($file in $nupkgFiles) {
113116
Write-Host "Publishing: $($file.FullName)"
114-
dotnet nuget push "$($file.FullName)" --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
117+
dotnet nuget push "$($file.FullName)" --api-key $apiKey --source "https://api.nuget.org/v3/index.json" --skip-duplicate
115118
}
116119
}

0 commit comments

Comments
 (0)