Commit 95471c29 authored by eric sciple's avatar eric sciple
Browse files

fail when submodules or ssh-key and fallback to REST API

parent 2a15e11d
Loading
Loading
Loading
Loading
+6
Changes for dist/index.js: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -5825,6 +5825,12 @@ function getSource(settings) {
            // Downloading using REST API
            core.info(`The repository will be downloaded using the GitHub REST API`);
            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.`);
            }
            yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
            return;
        }
+10
Changes for src/git-source-provider.ts: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -57,6 +57,16 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
    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,