Skip to content

How to have PRs read from Nuget GitHub Packages cache? #46395

Closed Answered by MarkCallow
MarkCallow asked this question in Q&A
Discussion options

You must be logged in to vote

I found the answer myself. Just use GITHUB_TOKEN instead of a creating a classic personal access token.

https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-packages?pivots=linux-runner is WRONG when it implies that you cannot use GITHUB_TOKEN by saying

"The built-in PAT provided by GITHUB_TOKEN only has the packages:read permission, you can use it if you plan to have a read-only binary cache in your workflow."

after describing how to create a classic PAT.

You can use GITHUB_TOKEN. Just add

   permissions:
      packages: write

to the jobs in your workflow, or to the entire workflow, and you will have a read-write cache. The permission will not be elevated when building …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MarkCallow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant