From 6f1b729011b34bc28608462b6293df85180aba9c Mon Sep 17 00:00:00 2001 From: eric sciple Date: Thu, 12 Mar 2020 11:42:38 -0400 Subject: persist core.sshCommand for submodules (#184) * persist core.sshCommand for submodules * update verbiage; add comments * fail when submodules or ssh-key and fallback to REST API --- src/git-source-provider.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/git-source-provider.ts') diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 7ce9fb7..4bce702 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -57,6 +57,16 @@ export async function getSource(settings: IGitSourceSettings): Promise { core.info( `To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH` ) + if (settings.submodules) { + throw new Error( + `Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.` + ) + } else if (settings.sshKey) { + throw new Error( + `Input 'ssh-key' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.` + ) + } + await githubApiHelper.downloadRepository( settings.authToken, settings.repositoryOwner, -- cgit v1.2.3