When setting "packages: write" permission in Github Action to publish the cache to Github Nuget Registry, reading from the registry fails with 403 #66683
Replies: 3 comments 1 reply
-
The issue you're encountering with GitHub Actions and GitHub Packages permissions is related to the difference between read and write permissions. When you set permissions: write for a GitHub token in your GitHub Actions workflow, it indeed grants the token the permission to write packages to the GitHub Package Registry. However, it does not implicitly grant read access. To resolve this issue and ensure that you can both read and write packages to the GitHub NuGet Registry, you need to modify your GitHub token permissions. Specifically, you should ensure that your GitHub token has both read and write permissions. Here's how you can modify your GitHub Actions workflow to include both read and write permissions for the token:
|
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
This is still an issue. The workaround appears to be to use your own token, but I'd like to see something more permanent. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
This question is related to both Github Actions and Github Packages
I have a job in Github actions where I am building packages using vcpkg and publishing the generated packages to Github Nuget Registry. So, I have set the following in my job:
I initially thought that when I set
write
,read
is implied from it but after testing it out, I realized that if I set the permission towrite
, I cannot read from the packages. Here is how I am trying to install and and publish to the registry:If I change to
permissions: read
, read works but write fails.Beta Was this translation helpful? Give feedback.
All reactions