Skip to content

Restore NuGet package created in another repo #26856

Answered by jcansdale
ghost asked this question in Packages
Discussion options

You must be logged in to vote

Hi @ghudik-cas,

However I thought that wouldn’t be required within the context of GitHub actions in the same org?

The ${{ secrets.GITHUB_TOKEN }} token is scoped to the workflow repository. What you can do is create an org level secret containing a PAT with the read:packages scope. You can then use something like ${{ secrets.READ_PACKAGES_TOKEN }} from your workflow.

I’m assuming I need to modify NuGet.config so it has the credentials like

Almost. If you’re using .NET Core 3.1 or above, you can create a nuget.config (all lowercase) file at the base of your repository like:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="github" value="http…

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@igiona
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@gautelo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Packages Host your dependencies, libraries, and production-ready code, right from your repository Product Feedback
4 participants