Unable to publish package #25395
-
I’m fighting on getting a nuget package published into GPR. Actions keeps flipping between unknown response and 401, any advice to help me clear this hurdle would be awesome:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@badgerowluke,
looks like, you directly replace the TOKEN with the GITHUB_TOKEN secret in the nuget.config file. In most cases, directly using the GITHUB_TOKEN secret in the config or setting files is not allowed. You need to set the GITHUB_TOKEN secret as an environment variable, then pass the environment variable into the config/setting files. Other secrets set in the GitHub repository are similar.
The following is a simple example as reference: TestGitHubPackagesRML/TestNuGet/blob/1bf4441f011b39ce4ddd659968db7acc7a05d73e/.github/workflows/CI.yml
This file has been truncated. show original github.com TestGitHubPackagesRML/TestNuGet/blob/1bf4441f011b39ce4ddd659968db7acc7a05d73e/TestNuGet/nuget.config
|
Beta Was this translation helpful? Give feedback.
-
Thanks man! That helps a ton |
Beta Was this translation helpful? Give feedback.
@badgerowluke,
I noticed the below step in your workflow,
looks like, you directly replace the TOKEN with the GITHUB_TOKEN secret in the nuget.config file.
In most cases, directly using the GITHUB_TOKEN secret in the config or setting files is not allowed. You need to set the GITHUB_TOKEN secret as an environment variable, then pass the environment variable into the config/setting files. Other secrets set in the GitHub repository are similar.
So, in your case, you can try like as below:
The following …