-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.ts
29 lines (26 loc) · 988 Bytes
/
config.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
import * as core from "@actions/core";
import { GitHubIssueReference } from "./models";
import { parseIssueUrl } from "./utils";
export interface Inputs {
rootIssue: GitHubIssueReference;
sectionTitle: string;
githubToken: string;
includeLegend: boolean;
includeFinishNode: boolean;
dryRun: boolean;
}
export const parseInputs = (): Inputs => {
const rootIssueUrl = core.getInput("root-issue-url", { required: true });
const rootIssue = parseIssueUrl(rootIssueUrl);
if (!rootIssue) {
throw new Error(`Failed to extract issue details from url '${rootIssueUrl}'`);
}
return {
rootIssue,
sectionTitle: core.getInput("section-title", { required: true }),
githubToken: core.getInput("github-token", { required: true }),
includeLegend: core.getBooleanInput("include-legend"),
includeFinishNode: core.getBooleanInput("include-finish-node"),
dryRun: core.getBooleanInput("dry-run"),
};
};