diff --git a/dist/index.js b/dist/index.js index f1a34de..9a60a47 100644 --- a/dist/index.js +++ b/dist/index.js @@ -33916,13 +33916,13 @@ class GitAuthHelper { this.settings = gitSourceSettings || {}; // Token auth header const serverUrl = urlHelper.getServerUrl(); - this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT] + this.tokenConfigKey = `http.${serverUrl.origin}${serverUrl.pathname}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT] const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64'); core.setSecret(basicCredential); this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`; this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`; // Instead of SSH URL - this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT] + this.insteadOfKey = `url.${serverUrl.origin}${serverUrl.pathname}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT] this.insteadOfValues.push(`git@${serverUrl.hostname}:`); if (this.settings.workflowOrganizationId) { this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`); @@ -36008,7 +36008,7 @@ function getFetchUrl(settings) { return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`; } // "origin" is SCHEME://HOSTNAME[:PORT] - return `${serviceUrl.origin}${serviceUrl.pathname}${encodedOwner}/${encodedName}`; + return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`; } exports.getFetchUrl = getFetchUrl; function getServerUrl() { diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index 8a1c7c3..1014133 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -53,7 +53,7 @@ class GitAuthHelper { // Token auth header const serverUrl = urlHelper.getServerUrl() - this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader` // "origin" is SCHEME://HOSTNAME[:PORT] + this.tokenConfigKey = `http.${serverUrl.origin}${serverUrl.pathname}/.extraheader` // "origin" is SCHEME://HOSTNAME[:PORT] const basicCredential = Buffer.from( `x-access-token:${this.settings.authToken}`, 'utf8' @@ -63,7 +63,7 @@ class GitAuthHelper { this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}` // Instead of SSH URL - this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf` // "origin" is SCHEME://HOSTNAME[:PORT] + this.insteadOfKey = `url.${serverUrl.origin}${serverUrl.pathname}/.insteadOf` // "origin" is SCHEME://HOSTNAME[:PORT] this.insteadOfValues.push(`git@${serverUrl.hostname}:`) if (this.settings.workflowOrganizationId) { this.insteadOfValues.push( diff --git a/src/url-helper.ts b/src/url-helper.ts index 15e0358..57afab1 100644 --- a/src/url-helper.ts +++ b/src/url-helper.ts @@ -16,7 +16,7 @@ export function getFetchUrl(settings: IGitSourceSettings): string { } // "origin" is SCHEME://HOSTNAME[:PORT] - return `${serviceUrl.origin}${serviceUrl.pathname}${encodedOwner}/${encodedName}` + return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}` } export function getServerUrl(): URL {