diff --git a/src/Runner.Common/ConfigurationStore.cs b/src/Runner.Common/ConfigurationStore.cs index 49c4229da..3dd5a8032 100644 --- a/src/Runner.Common/ConfigurationStore.cs +++ b/src/Runner.Common/ConfigurationStore.cs @@ -53,6 +53,9 @@ namespace GitHub.Runner.Common [DataMember(EmitDefaultValue = false)] public bool UseV2Flow { get; set; } + [DataMember(EmitDefaultValue = false)] + public string ServerUrlV2 { get; set; } + [IgnoreDataMember] public bool IsHostedServer { diff --git a/src/Runner.Listener/BrokerMessageListener.cs b/src/Runner.Listener/BrokerMessageListener.cs index e4f64ae6a..ac73bae3a 100644 --- a/src/Runner.Listener/BrokerMessageListener.cs +++ b/src/Runner.Listener/BrokerMessageListener.cs @@ -204,13 +204,12 @@ namespace GitHub.Runner.Listener private async Task RefreshBrokerConnection() { - var configManager = HostContext.GetService(); _settings = configManager.LoadSettings(); var credMgr = HostContext.GetService(); VssCredentials creds = credMgr.LoadCredentials(); - await _brokerServer.ConnectAsync(new Uri("http://broker.actions.localhost"), creds); + await _brokerServer.ConnectAsync(new Uri(_settings.ServerUrlV2), creds); } } }