Adding --check to run a serials network test against GitHub or GHES. (#900)

* add --check.
This commit is contained in:
Tingluo Huang
2021-01-14 13:26:07 -05:00
committed by GitHub
parent 3b34e203dc
commit 7ee333b5cd
22 changed files with 1404 additions and 16 deletions

View File

@@ -4,6 +4,13 @@ namespace GitHub.Runner.Sdk
{
public static class UrlUtil
{
public static bool IsHostedServer(UriBuilder gitHubUrl)
{
return string.Equals(gitHubUrl.Host, "github.com", StringComparison.OrdinalIgnoreCase) ||
string.Equals(gitHubUrl.Host, "www.github.com", StringComparison.OrdinalIgnoreCase) ||
string.Equals(gitHubUrl.Host, "github.localhost", StringComparison.OrdinalIgnoreCase);
}
public static Uri GetCredentialEmbeddedUrl(Uri baseUrl, string username, string password)
{
ArgUtil.NotNull(baseUrl, nameof(baseUrl));