Skip to content

Commit 449bc98

Browse files
author
Github Actions
committed
Fix quoting in Invoke-NuGetPublish function to ensure proper command execution for package publishing to GitHub Packages and NuGet.org. This change enhances reliability and prevents potential issues with command interpretation.
1 parent 4a2e8c2 commit 449bc98

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/PSBuild.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,13 +1324,13 @@ function Invoke-NuGetPublish {
13241324
Write-StepHeader "Publishing to GitHub Packages" -Tags "Invoke-NuGetPublish"
13251325

13261326
# Execute the command and stream output
1327-
"dotnet nuget push $BuildConfiguration.PackagePattern --api-key $BuildConfiguration.GithubToken --source `"https://nuget.pkg.github.com/$($BuildConfiguration.GithubOwner)/index.json`" --skip-duplicate" | Invoke-ExpressionWithLogging | Write-InformationStream -Tags "Invoke-NuGetPublish"
1327+
"dotnet nuget push `"$($BuildConfiguration.PackagePattern)`" --api-key `"$($BuildConfiguration.GithubToken)`" --source `"https://nuget.pkg.github.com/$($BuildConfiguration.GithubOwner)/index.json`" --skip-duplicate" | Invoke-ExpressionWithLogging | Write-InformationStream -Tags "Invoke-NuGetPublish"
13281328
Assert-LastExitCode "GitHub package publish failed"
13291329

13301330
Write-StepHeader "Publishing to NuGet.org" -Tags "Invoke-NuGetPublish"
13311331

13321332
# Execute the command and stream output
1333-
"dotnet nuget push $BuildConfiguration.PackagePattern --api-key $BuildConfiguration.NuGetApiKey --source `"https://api.nuget.org/v3/index.json`" --skip-duplicate" | Invoke-ExpressionWithLogging | Write-InformationStream -Tags "Invoke-NuGetPublish"
1333+
"dotnet nuget push `"$($BuildConfiguration.PackagePattern)`" --api-key `"$($BuildConfiguration.NuGetApiKey)`" --source `"https://api.nuget.org/v3/index.json`" --skip-duplicate" | Invoke-ExpressionWithLogging | Write-InformationStream -Tags "Invoke-NuGetPublish"
13341334
Assert-LastExitCode "NuGet.org package publish failed"
13351335
}
13361336

0 commit comments

Comments
 (0)