Replies: 3 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Think #47973 and actions/setup-dotnet#521 are about the same. |
Beta Was this translation helpful? Give feedback.
-
|
It seems that this issue occurs specifically when publishing the very first NuGet package for a given GitHub account or organization. Until the package exists, the first publish attempt via GitHub Actions fails with a 403 error. Once the package is manually pushed and configured, subsequent automated publishes work as expected. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
Describe the bug
When using GitHub Actions to publish a NuGet package to GitHub Packages for the first time, the workflow fails with a 403 error, despite using the correct GITHUB_TOKEN and having the permissions configured properly. The same package can be pushed manually from a local machine, and only after that can the pipeline succeed.
To Reproduce
Steps to reproduce the behavior:
Create a new NuGet package in a GitHub repository that has never published a package before.
Set up a GitHub Actions workflow like in NuGet sample:
Run the workflow.
Observe that it fails with:
error: Response status code does not indicate success: 403 (Forbidden).Check https://nuget.pkg.github.com/{OWNER}/query — no packages exist yet.
Expected behavior
The workflow should be able to push the first version of a NuGet package to GitHub Packages using GitHub Actions and a valid GITHUB_TOKEN or PAT.
Workaround
To make the pipeline succeed:
Push the package manually from a local machine using:
dotnet nuget push *.nupkg --api-key <PAT> --source "https://nuget.pkg.github.com/{OWNER}/index.json"Go to the Packages tab under the user/org profile.
Find the newly created package and click "Manage Actions access".
Explicitly assign the repository permission to publish the package.
Retry the workflow with new version — it now completes successfully.
Environment
GitHub Actions (ubuntu-latest)
.NET SDK 9.0.x
GitHub Packages (NuGet)
Additional context
This issue seems to occur only on the first publish attempt via Actions. It appears that repository access must be explicitly granted in the UI after the package exists, which cannot be done ahead of time from the pipeline.
Beta Was this translation helpful? Give feedback.
All reactions