处理内部签名文件地址
This commit is contained in:
21
download/dist/index.js
vendored
21
download/dist/index.js
vendored
@@ -2150,7 +2150,7 @@ function downloadArtifactInternal(artifactId, options) {
|
||||
core.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`);
|
||||
try {
|
||||
core.info(`Starting download of artifact to: ${downloadPath}`);
|
||||
yield streamExtract(signedUrl, downloadPath);
|
||||
yield streamExtract((0, config_1.normalizeDockerBridgeUrl)(signedUrl), downloadPath);
|
||||
core.info(`Artifact download completed successfully.`);
|
||||
}
|
||||
catch (error) {
|
||||
@@ -2673,7 +2673,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getResultsServiceUrl = exports.getRuntimeToken = exports.getUploadChunkSize = void 0;
|
||||
exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.normalizeDockerBridgeUrl = exports.getResultsServiceUrl = exports.getRuntimeToken = exports.getUploadChunkSize = void 0;
|
||||
const os_1 = __importDefault(__nccwpck_require__(22037));
|
||||
// Used for controlling the highWaterMark value of the zip that is being streamed
|
||||
// The same value is used as the chunk size that is use during upload to blob storage
|
||||
@@ -2694,20 +2694,23 @@ function getResultsServiceUrl() {
|
||||
if (!resultsUrl) {
|
||||
throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable');
|
||||
}
|
||||
const serviceUrl = new URL(resultsUrl);
|
||||
if (serviceUrl.protocol === 'https:' && isDockerBridgeIPv4(serviceUrl.hostname)) {
|
||||
serviceUrl.protocol = 'http:';
|
||||
}
|
||||
return serviceUrl.origin;
|
||||
return new URL(normalizeDockerBridgeUrl(resultsUrl)).origin;
|
||||
}
|
||||
exports.getResultsServiceUrl = getResultsServiceUrl;
|
||||
function normalizeDockerBridgeUrl(rawUrl) {
|
||||
const serviceUrl = new URL(rawUrl);
|
||||
if (serviceUrl.protocol === 'https:' && isDockerBridgeIPv4(serviceUrl.hostname)) {
|
||||
return `http:${rawUrl.slice('https:'.length)}`;
|
||||
}
|
||||
return rawUrl;
|
||||
}
|
||||
exports.normalizeDockerBridgeUrl = normalizeDockerBridgeUrl;
|
||||
function isDockerBridgeIPv4(hostname) {
|
||||
const octets = hostname.split('.').map(Number);
|
||||
return (octets.length === 4 &&
|
||||
octets.every(octet => Number.isInteger(octet) && octet >= 0 && octet <= 255) &&
|
||||
octets[0] === 172 &&
|
||||
octets[1] >= 16 &&
|
||||
octets[1] <= 31);
|
||||
octets[1] === 19);
|
||||
}
|
||||
function isGhes() {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user