npm run build
This commit is contained in:
parent
bac73aa464
commit
b7e22ddb5c
4 changed files with 40 additions and 26 deletions
25
dist/post/index.js
vendored
25
dist/post/index.js
vendored
|
|
@ -61421,6 +61421,11 @@ var CompressionMethod;
|
|||
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
||||
CompressionMethod["Zstd"] = "zstd";
|
||||
})(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"
|
||||
var external_path_ = __nccwpck_require__(5622);
|
||||
|
|
@ -61494,15 +61499,17 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
|
|||
});
|
||||
console.log("Service log:");
|
||||
console.log(journalLog);
|
||||
try {
|
||||
const cmd = "sudo";
|
||||
const args = ["cp", external_path_default().join(__dirname, "cache.txt"), cacheFile];
|
||||
external_child_process_.execFileSync(cmd, args);
|
||||
const cacheResult = yield cache.saveCache([cacheFile], cacheKey);
|
||||
console.log(cacheResult);
|
||||
}
|
||||
catch (exception) {
|
||||
console.log(exception);
|
||||
if (isValidEvent()) {
|
||||
try {
|
||||
const cmd = "cp";
|
||||
const args = [external_path_default().join(__dirname, "cache.txt"), cacheFile];
|
||||
external_child_process_.execFileSync(cmd, args);
|
||||
const cacheResult = yield cache.saveCache([cacheFile], cacheKey);
|
||||
console.log(cacheResult);
|
||||
}
|
||||
catch (exception) {
|
||||
console.log(exception);
|
||||
}
|
||||
}
|
||||
}))();
|
||||
function sleep(ms) {
|
||||
|
|
|
|||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
37
dist/pre/index.js
vendored
37
dist/pre/index.js
vendored
|
|
@ -7780,6 +7780,11 @@ var CompressionMethod;
|
|||
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
||||
CompressionMethod["Zstd"] = "zstd";
|
||||
})(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
|
||||
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 api_url = `https://${env}.api.stepsecurity.io/v1`;
|
||||
var web_url = "https://app.stepsecurity.io";
|
||||
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
|
||||
const confg = {
|
||||
repo: process.env["GITHUB_REPOSITORY"],
|
||||
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"),
|
||||
disable_telemetry: core.getBooleanInput("disable-telemetry"),
|
||||
};
|
||||
try {
|
||||
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`);
|
||||
confg.allowed_endpoints += ` ${url.hostname}:443`;
|
||||
}
|
||||
catch (exception) {
|
||||
// some exception has occurred.
|
||||
core.info("Unable to fetch cacheURL");
|
||||
if (confg.egress_policy === "block") {
|
||||
core.warning("Unable to fetch cacheURL switching egress-policy to audit mode");
|
||||
confg.egress_policy = "audit";
|
||||
if (isValidEvent()) {
|
||||
try {
|
||||
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`);
|
||||
confg.allowed_endpoints += ` ${url.hostname}:443`;
|
||||
}
|
||||
catch (exception) {
|
||||
// some exception has occurred.
|
||||
core.info("Unable to fetch cacheURL");
|
||||
if (confg.egress_policy === "block") {
|
||||
core.info("Switching egress-policy to audit mode");
|
||||
confg.egress_policy = "audit";
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
verifyChecksum(downloadPath); // NOTE: verifying agent's checksum, before extracting
|
||||
const extractPath = yield tool_cache.extractTar(downloadPath);
|
||||
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
|
||||
if (!confg.disable_telemetry || confg.egress_policy === "audit") {
|
||||
printInfo(web_url);
|
||||
}
|
||||
|
|
|
|||
2
dist/pre/index.js.map
vendored
2
dist/pre/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue