Skip to content

Commit e2592fc

Browse files
fix(ci): pass NuGet API key via --api-key (microsoft#683)
NuGetAuthenticate@1 doesn't support ApiKey service connections. Use dotnet nuget push with --api-key pipeline secret variable instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 492bbb4 commit e2592fc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pipelines/esrp-publish.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,10 @@ stages:
356356
ls -la $(Pipeline.Workspace)/nuget-publish/
357357
displayName: 'List packages'
358358
359-
- task: NuGetAuthenticate@1
360-
displayName: 'Authenticate to NuGet.org'
361-
inputs:
362-
nuGetServiceConnections: 'NuGet.org'
363-
364359
- script: |
365360
dotnet nuget push "$(Pipeline.Workspace)/nuget-publish/**/*.nupkg" \
366361
--source https://api.nuget.org/v3/index.json \
362+
--api-key $(NUGET_API_KEY) \
367363
--skip-duplicate
368364
displayName: 'Push to NuGet.org'
369365

0 commit comments

Comments
 (0)