Skip to content

Commit 01b581f

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

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@ Alternatively, consider adding auth for your GitHub Packages hosted NuGet feed u
7676
### .NET Framework
7777
7878
#### NuGet Authentication
79-
Utilize the [nuget/setup-nuget](https://github.com/nuget/setup-nuget#basic) action to pass package key/source to nuget exe.
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`
8080

8181
```yml
82-
- uses: nuget/setup-nuget@v1
83-
with:
84-
nuget-api-key: ${{ secrets.NuGetAPIKey }}
82+
- name: NuGet Restore
83+
run: |
84+
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 }}"
86+
nuget restore
8587
```
8688

8789
#### Manual Build Steps on Windows Runners

0 commit comments

Comments
 (0)