npm run build

This commit is contained in:
h0x0er 2022-09-26 22:26:36 +05:30
commit b7e22ddb5c
4 changed files with 40 additions and 26 deletions

25
dist/post/index.js vendored
View file

@ -61421,6 +61421,11 @@ var CompressionMethod;
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
CompressionMethod["Zstd"] = "zstd"; CompressionMethod["Zstd"] = "zstd";
})(CompressionMethod || (CompressionMethod = {})); })(CompressionMethod || (CompressionMethod = {}));
// Refer: https://github.com/actions/cache/blob/12681847c623a9274356751fdf0a63576ff3f846/src/utils/actionUtils.ts#L53
const RefKey = "GITHUB_REF";
function isValidEvent() {
return RefKey in process.env && Boolean(process.env[RefKey]);
}
// EXTERNAL MODULE: external "path" // EXTERNAL MODULE: external "path"
var external_path_ = __nccwpck_require__(5622); var external_path_ = __nccwpck_require__(5622);
@ -61494,15 +61499,17 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
}); });
console.log("Service log:"); console.log("Service log:");
console.log(journalLog); console.log(journalLog);
try { if (isValidEvent()) {
const cmd = "sudo"; try {
const args = ["cp", external_path_default().join(__dirname, "cache.txt"), cacheFile]; const cmd = "cp";
external_child_process_.execFileSync(cmd, args); const args = [external_path_default().join(__dirname, "cache.txt"), cacheFile];
const cacheResult = yield cache.saveCache([cacheFile], cacheKey); external_child_process_.execFileSync(cmd, args);
console.log(cacheResult); const cacheResult = yield cache.saveCache([cacheFile], cacheKey);
} console.log(cacheResult);
catch (exception) { }
console.log(exception); catch (exception) {
console.log(exception);
}
} }
}))(); }))();
function sleep(ms) { function sleep(ms) {

File diff suppressed because one or more lines are too long

37
dist/pre/index.js vendored
View file

@ -7780,6 +7780,11 @@ var CompressionMethod;
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long"; CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
CompressionMethod["Zstd"] = "zstd"; CompressionMethod["Zstd"] = "zstd";
})(CompressionMethod || (CompressionMethod = {})); })(CompressionMethod || (CompressionMethod = {}));
// Refer: https://github.com/actions/cache/blob/12681847c623a9274356751fdf0a63576ff3f846/src/utils/actionUtils.ts#L53
const RefKey = "GITHUB_REF";
function isValidEvent() {
return RefKey in process.env && Boolean(process.env[RefKey]);
}
;// CONCATENATED MODULE: ./src/setup.ts ;// CONCATENATED MODULE: ./src/setup.ts
var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
@ -7816,6 +7821,7 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
var env = "agent"; var env = "agent";
var api_url = `https://${env}.api.stepsecurity.io/v1`; var api_url = `https://${env}.api.stepsecurity.io/v1`;
var web_url = "https://app.stepsecurity.io"; var web_url = "https://app.stepsecurity.io";
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
const confg = { const confg = {
repo: process.env["GITHUB_REPOSITORY"], repo: process.env["GITHUB_REPOSITORY"],
run_id: process.env["GITHUB_RUN_ID"], run_id: process.env["GITHUB_RUN_ID"],
@ -7826,20 +7832,22 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
egress_policy: core.getInput("egress-policy"), egress_policy: core.getInput("egress-policy"),
disable_telemetry: core.getBooleanInput("disable-telemetry"), disable_telemetry: core.getBooleanInput("disable-telemetry"),
}; };
try { if (isValidEvent()) {
const cacheEntry = yield getCacheEntry([cacheKey], [cacheFile], { try {
compressionMethod: CompressionMethod.ZstdWithoutLong, const cacheEntry = yield getCacheEntry([cacheKey], [cacheFile], {
}); compressionMethod: CompressionMethod.ZstdWithoutLong,
const url = new URL(cacheEntry.archiveLocation); });
core.info(`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`); const url = new URL(cacheEntry.archiveLocation);
confg.allowed_endpoints += ` ${url.hostname}:443`; core.info(`Adding cacheHost: ${url.hostname}:443 to allowed-endpoints`);
} confg.allowed_endpoints += ` ${url.hostname}:443`;
catch (exception) { }
// some exception has occurred. catch (exception) {
core.info("Unable to fetch cacheURL"); // some exception has occurred.
if (confg.egress_policy === "block") { core.info("Unable to fetch cacheURL");
core.warning("Unable to fetch cacheURL switching egress-policy to audit mode"); if (confg.egress_policy === "block") {
confg.egress_policy = "audit"; core.info("Switching egress-policy to audit mode");
confg.egress_policy = "audit";
}
} }
} }
if (confg.egress_policy !== "audit" && confg.egress_policy !== "block") { if (confg.egress_policy !== "audit" && confg.egress_policy !== "block") {
@ -7870,7 +7878,6 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
const downloadPath = yield tool_cache.downloadTool("https://github.com/step-security/agent/releases/download/v0.11.0/agent_0.11.0_linux_amd64.tar.gz", undefined, auth); const downloadPath = yield tool_cache.downloadTool("https://github.com/step-security/agent/releases/download/v0.11.0/agent_0.11.0_linux_amd64.tar.gz", undefined, auth);
verifyChecksum(downloadPath); // NOTE: verifying agent's checksum, before extracting verifyChecksum(downloadPath); // NOTE: verifying agent's checksum, before extracting
const extractPath = yield tool_cache.extractTar(downloadPath); const extractPath = yield tool_cache.extractTar(downloadPath);
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
if (!confg.disable_telemetry || confg.egress_policy === "audit") { if (!confg.disable_telemetry || confg.egress_policy === "audit") {
printInfo(web_url); printInfo(web_url);
} }

File diff suppressed because one or more lines are too long