Repository navigation
[SFI-PS3.1] Avoid passing NuGet credentials on PowerShell command lines - #17276
Merged
missymessa merged 2 commits intoAug 7, 2026
Merged
missymessa merged 2 commits into
missymessa merged 2 commits into
Conversation
Read feed credentials from the Token environment variable in the maintained pipeline template while retaining a legacy parameter alias for existing custom consumers. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3eb6a0bd-11cc-4d7a-97ce-16e5d553f215
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Arcade’s internal feed setup to avoid placing NuGet feed credentials on PowerShell command lines, shifting credential delivery to the Token environment variable while keeping -Password as a compatibility alias for existing callers.
Changes:
- Update
SetupNugetSources.ps1to read credentials from$env:Token(with-Passwordaliased to-Credential) and propagate the renamed parameter through helper functions. - Update the
enable-internal-sources.ymltemplate PowerShell invocations to stop passing-Password ...on the command line and instead provideTokenviaenv:. - Update test script execution to provide the credential via an environment variable when invoking PowerShell.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Microsoft.DotNet.SetupNugetSources.Tests/ScriptRunner.cs | Switch PowerShell test invocation to pass credentials via Token environment variable instead of command-line args. |
| eng/common/SetupNugetSources.ps1 | Introduce -Credential (with -Password alias) and prefer $env:Token; propagate credential parameter through feed/credential helper functions. |
| eng/common/core-templates/steps/enable-internal-sources.yml | Remove -Password ... from PowerShell step arguments and pass Token via environment variables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use the Token environment variable for the maintained Bash template and tests, retain positional compatibility, and remove the helper's global username dependency. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3eb6a0bd-11cc-4d7a-97ce-16e5d553f215
missymessa
requested review from
MichaelSimons,
chcosta,
epananth,
garath,
haruna99,
meghnave and
mmitche
August 6, 2026 23:43
garath
approved these changes
Aug 7, 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.
Summary
Tokenenvironment variablePasswordand the Bash positional argument as compatibility fallbacks for existing custom consumersValidation
Build.cmd -test -projects src\Microsoft.DotNet.SetupNugetSources.Tests\Microsoft.DotNet.SetupNugetSources.Tests.csproj -configuration Release-PasswordaliasSFI KPI: [SFI-PS3.1] Security Code Scanning
Tracking: https://dev.azure.com/dnceng/internal/_workitems/edit/12139