Skip to content

Commit

Permalink
update checkout@v1 for GHES (actions#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple authored May 11, 2020
1 parent a246b3b commit 33d2d2c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Runner.Plugins/Repository/v1.0/GitSourceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ public async Task GetSourceAsync(
// Validate args.
ArgUtil.NotNull(executionContext, nameof(executionContext));
executionContext.Output($"Syncing repository: {repoFullName}");
Uri repositoryUrl = new Uri($"https://github.com/{repoFullName}");

// Repository URL
var githubUrl = executionContext.GetGitHubContext("url");
var githubUri = new Uri(!string.IsNullOrEmpty(githubUrl) ? githubUrl : "https://github.com");
var portInfo = githubUri.IsDefaultPort ? string.Empty : $":{githubUri.Port}";
Uri repositoryUrl = new Uri($"{githubUri.Scheme}://{githubUri.Host}{portInfo}/{repoFullName}");
if (!repositoryUrl.IsAbsoluteUri)
{
throw new InvalidOperationException("Repository url need to be an absolute uri.");
Expand Down

0 comments on commit 33d2d2c

Please sign in to comment.