From 6141233980300e529c17c07ed40b0c5452fd3058 Mon Sep 17 00:00:00 2001 From: Christopher Schleiden Date: Fri, 27 Mar 2020 10:32:15 -0700 Subject: [PATCH] Use different url format for accessing API --- .../Configuration/ConfigurationManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Runner.Listener/Configuration/ConfigurationManager.cs b/src/Runner.Listener/Configuration/ConfigurationManager.cs index baddb458e..f7013ffc6 100644 --- a/src/Runner.Listener/Configuration/ConfigurationManager.cs +++ b/src/Runner.Listener/Configuration/ConfigurationManager.cs @@ -200,7 +200,7 @@ namespace GitHub.Runner.Listener.Configuration } else { - // Create a new agent. + // Create a new agent. agent = CreateNewAgent(runnerSettings.AgentName, publicKey); try @@ -292,7 +292,7 @@ namespace GitHub.Runner.Listener.Configuration { // there are two exception messages server send that indicate clock skew. // 1. The bearer token expired on {jwt.ValidTo}. Current server time is {DateTime.UtcNow}. - // 2. The bearer token is not valid until {jwt.ValidFrom}. Current server time is {DateTime.UtcNow}. + // 2. The bearer token is not valid until {jwt.ValidFrom}. Current server time is {DateTime.UtcNow}. Trace.Error("Catch exception during test agent connection."); Trace.Error(ex); throw new Exception("The local machine's clock may be out of sync with the server time by more than five minutes. Please sync your clock with your domain or internet time and try again."); @@ -404,7 +404,7 @@ namespace GitHub.Runner.Listener.Configuration _term.WriteLine("Cannot connect to server, because config files are missing. Skipping removing runner from the server."); } - //delete credential config files + //delete credential config files currentAction = "Removing .credentials"; if (hasCredentials) { @@ -418,7 +418,7 @@ namespace GitHub.Runner.Listener.Configuration _term.WriteLine("Does not exist. Skipping " + currentAction); } - //delete settings config file + //delete settings config file currentAction = "Removing .runner"; if (isConfigured) { @@ -522,7 +522,7 @@ namespace GitHub.Runner.Listener.Configuration private async Task GetTenantCredential(string githubUrl, string githubToken, string runnerEvent) { var gitHubUrlBuilder = new UriBuilder(githubUrl); - var githubApiUrl = $"{gitHubUrlBuilder.Scheme}://api.{gitHubUrlBuilder.Host}/actions/runner-registration"; + var githubApiUrl = $"{gitHubUrlBuilder.Scheme}://{gitHubUrlBuilder.Host}/api/v3/actions/runner-registration"; using (var httpClientHandler = HostContext.CreateHttpClientHandler()) using (var httpClient = new HttpClient(httpClientHandler)) {