Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple committed Mar 11, 2020
1 parent 0231cba commit 7b6365b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dist/index.js
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 5 additions & 3 deletions src/git-source-provider.ts
Expand Up @@ -21,7 +21,7 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
const repositoryUrl = settings.sshKey
? `git@${hostname}:${encodeURIComponent(
settings.repositoryOwner
)}/${encodeURIComponent(settings.repositoryName)}`
)}/${encodeURIComponent(settings.repositoryName)}.git`
: `https://${hostname}/${encodeURIComponent(
settings.repositoryOwner
)}/${encodeURIComponent(settings.repositoryName)}`
Expand Down Expand Up @@ -120,8 +120,10 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
// 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)
Expand Down

0 comments on commit 7b6365b

Please sign in to comment.