sdfsdf xcvxcvxcv
This commit is contained in:
6
dist/index.js
vendored
6
dist/index.js
vendored
@@ -33916,13 +33916,13 @@ class GitAuthHelper {
|
|||||||
this.settings = gitSourceSettings || {};
|
this.settings = gitSourceSettings || {};
|
||||||
// Token auth header
|
// Token auth header
|
||||||
const serverUrl = urlHelper.getServerUrl();
|
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');
|
const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
|
||||||
core.setSecret(basicCredential);
|
core.setSecret(basicCredential);
|
||||||
this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
|
this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
|
||||||
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
|
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
|
||||||
// Instead of SSH URL
|
// 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}:`);
|
this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
|
||||||
if (this.settings.workflowOrganizationId) {
|
if (this.settings.workflowOrganizationId) {
|
||||||
this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
|
this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
|
||||||
@@ -36008,7 +36008,7 @@ function getFetchUrl(settings) {
|
|||||||
return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
|
return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
|
||||||
}
|
}
|
||||||
// "origin" is SCHEME://HOSTNAME[:PORT]
|
// "origin" is SCHEME://HOSTNAME[:PORT]
|
||||||
return `${serviceUrl.origin}${serviceUrl.pathname}${encodedOwner}/${encodedName}`;
|
return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`;
|
||||||
}
|
}
|
||||||
exports.getFetchUrl = getFetchUrl;
|
exports.getFetchUrl = getFetchUrl;
|
||||||
function getServerUrl() {
|
function getServerUrl() {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class GitAuthHelper {
|
|||||||
|
|
||||||
// Token auth header
|
// Token auth header
|
||||||
const serverUrl = urlHelper.getServerUrl()
|
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(
|
const basicCredential = Buffer.from(
|
||||||
`x-access-token:${this.settings.authToken}`,
|
`x-access-token:${this.settings.authToken}`,
|
||||||
'utf8'
|
'utf8'
|
||||||
@@ -63,7 +63,7 @@ class GitAuthHelper {
|
|||||||
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`
|
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`
|
||||||
|
|
||||||
// Instead of SSH URL
|
// 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}:`)
|
this.insteadOfValues.push(`git@${serverUrl.hostname}:`)
|
||||||
if (this.settings.workflowOrganizationId) {
|
if (this.settings.workflowOrganizationId) {
|
||||||
this.insteadOfValues.push(
|
this.insteadOfValues.push(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function getFetchUrl(settings: IGitSourceSettings): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// "origin" is SCHEME://HOSTNAME[:PORT]
|
// "origin" is SCHEME://HOSTNAME[:PORT]
|
||||||
return `${serviceUrl.origin}${serviceUrl.pathname}${encodedOwner}/${encodedName}`
|
return `${serviceUrl.origin}${serviceUrl.pathname}/${encodedOwner}/${encodedName}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getServerUrl(): URL {
|
export function getServerUrl(): URL {
|
||||||
|
|||||||
Reference in New Issue
Block a user