Skip to content

Commit b4189a9

Browse files
authored
Update compiled-languages-csharp.md
1 parent 01b581f commit b4189a9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

troubleshooting/codeql-builds/compiled-languages-csharp.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,23 @@ Alternatively, consider adding auth for your GitHub Packages hosted NuGet feed u
7676
### .NET Framework
7777
7878
#### NuGet Authentication
79-
Since you are unable to use the [nuget/setup-nuget](https://github.com/nuget/setup-nuget#basic) action to pass package key/source to nuget exe for restore, instead fallback to the nuget sources commands. You can update a source (by name) to include credentials via the `nuget sources Update` command or add a new source with `nuget sources Add`
79+
Since you are unable to use the [nuget/setup-nuget](https://github.com/nuget/setup-nuget#basic) action to pass package key/source to nuget exe for restore, instead fallback to the nuget sources commands.
80+
81+
You can update an existing source (by name - these might exist in a `nuget.config`) to include credentials via the `nuget sources Update` command
82+
83+
```yml
84+
- name: NuGet Restore
85+
run: |
86+
nuget sources Update -Name "SourceName" -UserName "any" -Password "${{ secrets.NUGET_PACKAGES_PAT }}"
87+
nuget restore
88+
```
89+
90+
Alternatively, add a new source with `nuget sources Add`
8091

8192
```yml
8293
- name: NuGet Restore
8394
run: |
8495
nuget sources Add -Name "SourceName" -Source "https://url.to.your/source" -UserName "any" -Password "${{ secrets.NUGET_PACKAGES_PAT }}"
85-
nuget sources Update -Name "SourceName" -UserName "any" -Password "${{ secrets.NUGET_PACKAGES_PAT }}"
8696
nuget restore
8797
```
8898

0 commit comments

Comments
 (0)