actions / setup-dotnet

Set up your GitHub Actions workflow with a specific version of the .NET core sdk
MIT License
919 stars 452 forks source link

NUGET_AUTH_TOKEN does not work for official NuGet repository #526

Open na1307 opened 1 month ago

na1307 commented 1 month ago

Description: I tried publishing the package using source-url and NUGET_AUTH_TOKEN, but it failed with the error API key not found.

warn : No API Key was provided and no API Key could be found for 'https://www.nuget.org/api/v2/package'. To save an API Key for a source use the 'setApiKey' command.
Pushing Bluehill.Hangul.2.1.0-gh-actions-test.1.nupkg to 'https://www.nuget.org/api/v2/package'...
  PUT https://www.nuget.org/api/v2/package/
  Unauthorized https://www.nuget.org/api/v2/package/ 303ms
error: Response status code does not indicate success: 401 (An API key must be provided in the 'X-NuGet-ApiKey' header to use this service).

Task version: v4

Platform:

Runner type:

Repro steps:
https://github.com/na1307/Bluehill.Hangul/blob/9702f8b7432c8cbf088a829cef16c661a40c4efa/.github/workflows/dotnet.yml

Expected behavior: The package should publish normally.

Actual behavior: The package won't be published with an error about missing an API key.

aparnajyothi-y commented 1 month ago

Hello @na1307, Thank you for creating this issue and we will look into it :)