Skip to content

Commit 3a7e655

Browse files
committed
uses nuget api key from credentials
Uses the NuGet API key from the credentials configuration.
1 parent aa56e4d commit 3a7e655

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/_publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616

1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
1920
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
2021
steps:
2122
-

build/publish/Tasks/PublishNuget.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public override async Task RunAsync(BuildContext context)
4343
if (context.IsStableRelease || context.IsTaggedPreRelease)
4444
{
4545
context.StartGroup("Publishing to Nuget.org");
46-
var apiKey = await GetNugetApiKey(context);
46+
var apiKey = context.Credentials?.Nuget?.ApiKey;
4747
if (string.IsNullOrEmpty(apiKey))
4848
{
4949
throw new InvalidOperationException("Could not resolve NuGet org API key.");
@@ -52,6 +52,8 @@ public override async Task RunAsync(BuildContext context)
5252
PublishToNugetRepo(context, apiKey, Constants.NugetOrgUrl);
5353
context.EndGroup();
5454
}
55+
56+
await Task.CompletedTask;
5557
}
5658

5759
private static void PublishToNugetRepo(BuildContext context, string apiKey, string apiUrl)

0 commit comments

Comments
 (0)