File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments