.NET and NuGet
NuGet in a pipeline
Add the feed with one command and restore.
In a pipeline, add the feed from the command line with the token from a secret variable:
$ dotnet nuget add source https://packages.example.com/nuget/v3/index.json -n company -u your-user-name -p "$REPO_TOKEN" --store-password-in-clear-text Package source with Name: company added successfully. $ dotnet restore Determining projects to restore... Restored /work/ci/ci.csproj (in 573 ms).
Captured by running these commands against a real ForgeRepo™.
Note
The password is only stored in the build machine's own NuGet settings. Use a token made for the pipeline, not your personal one.