Add error messages
This commit is contained in:
parent
8a5e683d80
commit
2f492642fe
3 changed files with 17 additions and 1 deletions
6
dist/pre/index.js
vendored
6
dist/pre/index.js
vendored
|
|
@ -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");
|
||||
|
|
|
|||
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
10
src/setup.ts
10
src/setup.ts
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue