add _IS_GITHUB to overwrite URL switch.

This commit is contained in:
TingluoHuang
2020-03-26 22:31:25 -04:00
parent e23d68f6e2
commit 5e670caa0b

View File

@@ -93,9 +93,11 @@ namespace GitHub.Runner.Listener.Configuration
while (true) while (true)
{ {
// Get the URL // Get the URL
var isGitHub = StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("_IS_GITHUB"));
var inputUrl = command.GetUrl(); var inputUrl = command.GetUrl();
if (!inputUrl.Contains("github.com", StringComparison.OrdinalIgnoreCase) && if (!inputUrl.Contains("github.com", StringComparison.OrdinalIgnoreCase) &&
!inputUrl.Contains("github.localhost", StringComparison.OrdinalIgnoreCase)) !inputUrl.Contains("github.localhost", StringComparison.OrdinalIgnoreCase) &&
!isGitHub)
{ {
runnerSettings.ServerUrl = inputUrl; runnerSettings.ServerUrl = inputUrl;
// Get the credentials // Get the credentials