diff --git a/dist/index.js b/dist/index.js index ca63e891f..56cf864c9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5796,7 +5796,7 @@ function getSource(settings) { // Repository URL core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`); const repositoryUrl = settings.sshKey - ? `git@${hostname}:${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}` + ? `git@${hostname}:${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}.git` : `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`; // Remove conflicting file path if (fsHelper.fileExistsSync(settings.repositoryPath)) { @@ -5856,8 +5856,10 @@ function getSource(settings) { // Submodules if (settings.submodules) { try { - // Temporarily override global config - yield authHelper.configureGlobalAuth(); + if (!settings.sshKey) { // TODO REMOVE THIS CONDITION, TESTING + // Temporarily override global config + yield authHelper.configureGlobalAuth(); + } // Checkout submodules yield git.submoduleSync(settings.nestedSubmodules); yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules); diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 423c62d87..d82cf84f5 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -21,7 +21,7 @@ export async function getSource(settings: IGitSourceSettings): Promise { const repositoryUrl = settings.sshKey ? `git@${hostname}:${encodeURIComponent( settings.repositoryOwner - )}/${encodeURIComponent(settings.repositoryName)}` + )}/${encodeURIComponent(settings.repositoryName)}.git` : `https://${hostname}/${encodeURIComponent( settings.repositoryOwner )}/${encodeURIComponent(settings.repositoryName)}` @@ -120,8 +120,10 @@ export async function getSource(settings: IGitSourceSettings): Promise { // Submodules if (settings.submodules) { try { - // Temporarily override global config - await authHelper.configureGlobalAuth() + if (!settings.sshKey) { // TODO REMOVE THIS CONDITION, TESTING + // Temporarily override global config + await authHelper.configureGlobalAuth() + } // Checkout submodules await git.submoduleSync(settings.nestedSubmodules)