Fix NuGet package path validation in nuget-stage pipeline#40293
Merged
Fix NuGet package path validation in nuget-stage pipeline#40293
Conversation
Use absolute paths for artifact download and packagesToPush so that the NuGet validation step can verify the package location. The relative path 'drop/nuget/...' was not recognized as being under the expected parent directory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes NuGet publish validation failures in the nuget-stage Azure DevOps pipeline by ensuring both the artifact download location and the packagesToPush path are rooted under $(Build.SourcesDirectory) (i.e., an allowed parent directory for the pipeline’s path validation).
Changes:
- Update
DownloadPipelineArtifact@2to download the NuGet artifact into$(Build.SourcesDirectory)\drop. - Update
NuGetCommand@2packagesToPushto reference the downloaded.nupkgvia an absolute path under$(Build.SourcesDirectory)\drop\nuget\....
yao-msft
approved these changes
Apr 24, 2026
OneBlue
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The NuGet publish step in the nuget-stage pipeline used relative paths for both the artifact download and packagesToPush. The pipeline validation requires these paths to start with the expected parent directory.
This change makes both paths absolute using Build.SourcesDirectory so that the download location and the push path are consistent and pass validation.