-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
33 lines (27 loc) · 1.07 KB
/
index.ts
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
import * as core from "@actions/core";
import run from "./scripts/lane-branch";
try {
const wsDir: string = core.getInput("ws-dir") || process.env.WSDIR || "./";
const args = process.env.LOG? [`--log=${process.env.LOG}`]: [];
const laneName: string = core.getInput("lane-name");
const branchName: string = core.getInput("branch-name") || laneName;
const skipPush: boolean = core.getInput("skip-push") === "true" ? true : false;
const skipCI: boolean = core.getInput("skip-ci") === "false" ? false : true;
if (!laneName) {
throw new Error("Lane name is not found");
}
if (laneName === "main") {
throw new Error('Specify a lane other than "main"!');
}
const gitUserName = process.env.GIT_USER_NAME;
if (!gitUserName) {
throw new Error("Git user name not found");
}
const gitUserEmail = process.env.GIT_USER_EMAIL;
if (!gitUserEmail) {
throw new Error("Git user email token not found");
}
run(skipPush, skipCI, laneName, branchName, gitUserName, gitUserEmail, wsDir, args);
} catch (error) {
core.setFailed((error as Error).message);
}