From e33cfa574212e8722034156757f8383979e76cb9 Mon Sep 17 00:00:00 2001 From: Peter Murray <681306+peter-murray@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:34:52 +0100 Subject: Inject GitHub host to be able to clone from another GitHub instance (#922) * Adding the ability to specify the GitHub Server URL and allowing for it to differ from the Actions workflow host * Adding tests for injecting the GitHub URL * Addressing code review comments for PR #922 --- src/git-auth-helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/git-auth-helper.ts') diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index 8a1c7c3..3c6db8e 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -52,7 +52,7 @@ class GitAuthHelper { this.settings = gitSourceSettings || (({} as unknown) as IGitSourceSettings) // Token auth header - const serverUrl = urlHelper.getServerUrl() + const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl) this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader` // "origin" is SCHEME://HOSTNAME[:PORT] const basicCredential = Buffer.from( `x-access-token:${this.settings.authToken}`, -- cgit v1.2.3