diff --git a/build/Build.cs b/build/Build.cs index d14b0c066..6e23f9833 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -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)) { @@ -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");