1
0
Fork 0
mirror of synced 2026-06-05 18:55:14 +00:00

Add error messages

This commit is contained in:
Varun Sharma 2021-12-06 12:33:24 -08:00
commit 2f492642fe
3 changed files with 17 additions and 1 deletions

6
dist/pre/index.js vendored
View file

@ -6300,6 +6300,12 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
allowed_endpoints: core.getInput("allowed-endpoints"),
egress_policy: core.getInput("egress-policy"),
};
if (confg.egress_policy !== "audit" && confg.egress_policy !== "block") {
core.error("egress-policy must be either audit or block");
}
if (confg.egress_policy === "block" && confg.allowed_endpoints === "") {
core.warning("egress-policy is set to block (default) and allowed-endpoints is empty. No outbound traffic will be allowed for job steps.");
}
const confgStr = JSON.stringify(confg);
external_child_process_.execSync("sudo mkdir -p /home/agent");
external_child_process_.execSync("sudo chown -R $USER /home/agent");

File diff suppressed because one or more lines are too long

View file

@ -34,6 +34,16 @@ import * as tc from "@actions/tool-cache";
egress_policy: core.getInput("egress-policy"),
};
if (confg.egress_policy !== "audit" && confg.egress_policy !== "block") {
core.error("egress-policy must be either audit or block");
}
if (confg.egress_policy === "block" && confg.allowed_endpoints === "") {
core.warning(
"egress-policy is set to block (default) and allowed-endpoints is empty. No outbound traffic will be allowed for job steps."
);
}
const confgStr = JSON.stringify(confg);
cp.execSync("sudo mkdir -p /home/agent");
cp.execSync("sudo chown -R $USER /home/agent");