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-source-provider.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/git-source-provider.ts') diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 545a7a3..48f20da 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -93,7 +93,8 @@ export async function getSource(settings: IGitSourceSettings): Promise { settings.repositoryName, settings.ref, settings.commit, - settings.repositoryPath + settings.repositoryPath, + settings.githubServerUrl ) return } @@ -138,7 +139,8 @@ export async function getSource(settings: IGitSourceSettings): Promise { settings.ref = await githubApiHelper.getDefaultBranch( settings.authToken, settings.repositoryOwner, - settings.repositoryName + settings.repositoryName, + settings.githubServerUrl ) } core.endGroup() @@ -232,7 +234,8 @@ export async function getSource(settings: IGitSourceSettings): Promise { settings.repositoryOwner, settings.repositoryName, settings.ref, - settings.commit + settings.commit, + settings.githubServerUrl ) } finally { // Remove auth -- cgit v1.2.3