Skip to content

Commit

Permalink
🧱 Update scan/dist/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and tiulpin committed Jan 17, 2024
1 parent 009bc2e commit adb78a5
Showing 1 changed file with 50 additions and 20 deletions.
70 changes: 50 additions & 20 deletions scan/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27036,18 +27036,18 @@ var require_constants5 = __commonJS({
(function(CacheFilename2) {
CacheFilename2["Gzip"] = "cache.tgz";
CacheFilename2["Zstd"] = "cache.tzst";
})(CacheFilename = exports2.CacheFilename || (exports2.CacheFilename = {}));
})(CacheFilename || (exports2.CacheFilename = CacheFilename = {}));
var CompressionMethod;
(function(CompressionMethod2) {
CompressionMethod2["Gzip"] = "gzip";
CompressionMethod2["ZstdWithoutLong"] = "zstd-without-long";
CompressionMethod2["Zstd"] = "zstd";
})(CompressionMethod = exports2.CompressionMethod || (exports2.CompressionMethod = {}));
})(CompressionMethod || (exports2.CompressionMethod = CompressionMethod = {}));
var ArchiveToolType;
(function(ArchiveToolType2) {
ArchiveToolType2["GNU"] = "gnu";
ArchiveToolType2["BSD"] = "bsd";
})(ArchiveToolType = exports2.ArchiveToolType || (exports2.ArchiveToolType = {}));
})(ArchiveToolType || (exports2.ArchiveToolType = ArchiveToolType = {}));
exports2.DefaultRetryAttempts = 2;
exports2.DefaultRetryDelay = 5e3;
exports2.SocketTimeout = 5e3;
Expand Down Expand Up @@ -27198,20 +27198,16 @@ var require_cacheUtils = __commonJS({
implicitDescendants: false
});
try {
for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; ) {
for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
_c = _g.value;
_e = false;
try {
const file = _c;
const relativeFile = path.relative(workspace, file).replace(new RegExp(`\\${path.sep}`, "g"), "/");
core2.debug(`Matched: ${relativeFile}`);
if (relativeFile === "") {
paths.push(".");
} else {
paths.push(`${relativeFile}`);
}
} finally {
_e = true;
const file = _c;
const relativeFile = path.relative(workspace, file).replace(new RegExp(`\\${path.sep}`, "g"), "/");
core2.debug(`Matched: ${relativeFile}`);
if (relativeFile === "") {
paths.push(".");
} else {
paths.push(`${relativeFile}`);
}
}
} catch (e_1_1) {
Expand Down Expand Up @@ -79332,7 +79328,7 @@ var require_cacheHttpClient = __commonJS({
}
__name(createHttpClient, "createHttpClient");
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
const components = paths;
const components = paths.slice();
if (compressionMethod) {
components.push(compressionMethod);
}
Expand Down Expand Up @@ -90095,7 +90091,7 @@ var require_package = __commonJS({
"../node_modules/@actions/artifact/package.json"(exports2, module2) {
module2.exports = {
name: "@actions/artifact",
version: "2.0.0",
version: "2.0.1",
preview: true,
description: "Actions artifact lib",
keywords: [
Expand Down Expand Up @@ -124412,7 +124408,7 @@ var require_download_artifact = __commonJS({
return mod && mod.__esModule ? mod : { "default": mod };
};
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.downloadArtifactInternal = exports2.downloadArtifactPublic = void 0;
exports2.downloadArtifactInternal = exports2.downloadArtifactPublic = exports2.streamExtractExternal = void 0;
var promises_1 = __importDefault2(require("fs/promises"));
var github2 = __importStar3(require_github2());
var core2 = __importStar3(require_core());
Expand Down Expand Up @@ -124445,18 +124441,52 @@ var require_download_artifact = __commonJS({
}
__name(exists, "exists");
function streamExtract(url, directory) {
return __awaiter3(this, void 0, void 0, function* () {
let retryCount = 0;
while (retryCount < 5) {
try {
yield streamExtractExternal(url, directory);
return;
} catch (error) {
retryCount++;
core2.debug(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`);
yield new Promise((resolve) => setTimeout(resolve, 5e3));
}
}
throw new Error(`Artifact download failed after ${retryCount} retries.`);
});
}
__name(streamExtract, "streamExtract");
function streamExtractExternal(url, directory) {
return __awaiter3(this, void 0, void 0, function* () {
const client = new httpClient.HttpClient((0, user_agent_1.getUserAgentString)());
const response = yield client.get(url);
if (response.message.statusCode !== 200) {
throw new Error(`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`);
}
const timeout = 30 * 1e3;
return new Promise((resolve, reject) => {
response.message.pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", resolve).on("error", reject);
const timerFn = /* @__PURE__ */ __name(() => {
response.message.destroy(new Error(`Blob storage chunk did not respond in ${timeout}ms`));
}, "timerFn");
const timer = setTimeout(timerFn, timeout);
response.message.on("data", () => {
timer.refresh();
}).on("error", (error) => {
core2.debug(`response.message: Artifact download failed: ${error.message}`);
clearTimeout(timer);
reject(error);
}).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => {
clearTimeout(timer);
resolve();
}).on("error", (error) => {
reject(error);
});
});
});
}
__name(streamExtract, "streamExtract");
__name(streamExtractExternal, "streamExtractExternal");
exports2.streamExtractExternal = streamExtractExternal;
function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) {
return __awaiter3(this, void 0, void 0, function* () {
const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path);
Expand Down

0 comments on commit adb78a5

Please sign in to comment.