Skip to content

Commit 076aa7f

Browse files
authored
Merge pull request #801 from valadas/prefer-github-token
Fixed a deployment issue
2 parents 4876cb0 + a4928a8 commit 076aa7f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

build/Build.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ static int FindFreePort(int startPort)
181181
}
182182
}
183183

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

188189
if (string.IsNullOrEmpty(token))
189190
{
@@ -237,9 +238,13 @@ static int FindFreePort(int startPort)
237238
.DependsOn(CreateDeployBranch)
238239
.DependsOn(Compile)
239240
.Executes(() => {
241+
var token = GithubToken;
242+
if (string.IsNullOrEmpty(token))
243+
token = Environment.GetEnvironmentVariable("ACCESS_TOKEN");
244+
240245
Git("config --global user.name 'DNN Community'");
241246
Git("config --global user.email 'info@dnncommunity.org'");
242-
Git($"remote set-url origin https://{organizationName}:{GithubToken}@github.com/{organizationName}/{repositoryName}.git");
247+
Git($"remote set-url origin https://{organizationName}:{token}@github.com/{organizationName}/{repositoryName}.git");
243248
Git("status");
244249
Git("add docs -f"); // Force adding because it is usually gitignored.
245250
Git("status");

0 commit comments

Comments
 (0)