Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ static int FindFreePort(int startPort)
}
}

var token = Environment.GetEnvironmentVariable("ACCESS_TOKEN");
// Prefer the GitHub Actions-provided token in CI, then fall back to ACCESS_TOKEN.
var token = GithubToken;
if (string.IsNullOrEmpty(token))
token = GithubToken;
token = Environment.GetEnvironmentVariable("ACCESS_TOKEN");

if (string.IsNullOrEmpty(token))
{
Expand Down Expand Up @@ -237,9 +238,13 @@ static int FindFreePort(int startPort)
.DependsOn(CreateDeployBranch)
.DependsOn(Compile)
.Executes(() => {
var token = GithubToken;
if (string.IsNullOrEmpty(token))
token = Environment.GetEnvironmentVariable("ACCESS_TOKEN");

Git("config --global user.name 'DNN Community'");
Git("config --global user.email 'info@dnncommunity.org'");
Git($"remote set-url origin https://{organizationName}:{GithubToken}@github.com/{organizationName}/{repositoryName}.git");
Git($"remote set-url origin https://{organizationName}:{token}@github.com/{organizationName}/{repositoryName}.git");
Git("status");
Git("add docs -f"); // Force adding because it is usually gitignored.
Git("status");
Expand Down
Loading