Skip to content

Commit

Permalink
fix(build): Inject gh token directly
Browse files Browse the repository at this point in the history
  • Loading branch information
jcathalina committed Oct 16, 2024
1 parent 23efb7d commit d3be79d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ sealed partial class Build : NukeBuild
: null;

string[] Configurations;
[Secret] [Nuke.Common.Parameter] string GitHubToken;

Target Print => _ => _
.Before(Clean)
Expand Down Expand Up @@ -122,14 +123,14 @@ List<string> GlobBuildConfigurations()

Target PublishToGitHub => _ => _
.DependsOn(Pack)
.Requires(() => GitHubActions.Token)
.Requires(() => GitHubToken)
.Requires(() => GitRepository)
.OnlyWhenStatic(() => IsServerBuild && (GitRepository.IsOnDevelopBranch() || GitRepository.IsOnReleaseBranch()))
.Executes(async () =>
{
GitHubTasks.GitHubClient = new GitHubClient(new ProductHeaderValue(Solution.Name))
{
Credentials = new Credentials(GitHubActions.Token)
Credentials = new Credentials(GitHubToken)
};

var gitHubName = GitRepository.GetGitHubName();
Expand Down

0 comments on commit d3be79d

Please sign in to comment.