We currently have a github nuget registry with pri...
# dotnet
g
We currently have a github nuget registry with private packages. I cannot seem to get Pulumi to add the nuget source. I've tried several different versions from what I've found online and in the docs, but none of these do anything. The commands don't seem to run. So dotnet build fails since it cannot find the private packages.
Copy code
var addNugetSourceCommand = new Command("addNugetSourceCommand", new CommandArgs
{
    Create = "dotnet nuget add source --name github \"$GITHUB_NUGET_SOURCE\" --username \"$GITHUB_USER\" --password \"$GITHUB_TOKEN\" --store-password-in-clear-text",
    Environment = 
    {
        { "GITHUB_NUGET_SOURCE", "{REGISTRY_URL}" },
        { "GITHUB_USER", "USERNAME" },
        { "GITHUB_TOKEN", "token" }
    }
});

        var dotnetBuildCommand = new Command("dotnetBuildCommand", new CommandArgs
        {
            Create = "dotnet build",
        }, new CustomResourceOptions
        {
            DependsOn = new[] { addNugetSourceCommand }
        });
e
The pulumi command resource is stateful, so once it's "created" it won't run again. You could use the trigger option to just always re-create it, but it might make more sense to just combine these commands into one command string so you know they always run together.
g
@echoing-dinner-19531 thank you! I actually realized I can include a Nuget.config in the repo and pass the env variables to it. Which seems to be a cleaner way of doing this. But if I can't get that to work I'll try this!