-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (32 loc) · 906 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import core from "@actions/core";
import { getInput, getBooleanInput } from "./src/utils.js";
import Action from "./src/action/Action.js";
const getAction = () => {
return new Action(
getInput("aws_access_key_id"),
getInput("aws_secret_access_key"),
getInput("aws_region"),
getInput("secret_name"),
getInput("json_file_path"),
getInput("exclude"),
getBooleanInput("show_values", false),
getBooleanInput("create_secret", false),
getBooleanInput("delete_secret", false),
);
};
const run = async () => {
try {
const dryRun = getBooleanInput("dry_run", false);
const changeSet = await getAction().run();
for (const desc of changeSet.changeDesc()) {
core.info(desc);
}
if (!dryRun) {
await changeSet.apply();
core.info("Secrets has been synced!!");
}
} catch (error) {
core.setFailed(error.message);
}
};
run();