Skip to content

Commit 08b777c

Browse files
committed
(build) small improvements
1 parent 6248e31 commit 08b777c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/homebrew.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: dawidd6/[email protected]
1212
with:
1313
# GitHub token, required, not the default one
14-
token: ${{secrets.HOMEBREW_GITHUB_TOKEN}}
14+
token: ${{secrets.RELEASE_GITHUB_TOKEN}}
1515
# Formula name, required
1616
formula: gitversion
1717
tag: ${{ github.event.client_payload.ref }}

build/publish/Tasks/PublishNuget.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public override void Run(BuildContext context)
3737
if (context.IsGitHubActionsBuild && context.IsOnMainBranchOriginalRepo)
3838
{
3939
var apiKey = context.Credentials?.GitHub?.Token;
40+
if (string.IsNullOrEmpty(apiKey))
41+
{
42+
throw new InvalidOperationException("Could not resolve NuGet GitHub Packages API key.");
43+
}
4044
PublishToNugetRepo(context, apiKey, Constants.GithubPackagesUrl);
4145
}
4246
// publish to nuget.org for stable releases
@@ -51,7 +55,7 @@ public override void Run(BuildContext context)
5155
PublishToNugetRepo(context, apiKey, Constants.NugetOrgUrl);
5256
}
5357
}
54-
private static void PublishToNugetRepo(BuildContext context, string? apiKey, string? apiUrl)
58+
private static void PublishToNugetRepo(BuildContext context, string apiKey, string apiUrl)
5559
{
5660
var nugetVersion = context.Version!.NugetVersion;
5761
foreach (var (packageName, filePath, _) in context.Packages.Where(x => !x.IsChocoPackage))

0 commit comments

Comments
 (0)