-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
37 lines (33 loc) · 1.09 KB
/
types.ts
File metadata and controls
37 lines (33 loc) · 1.09 KB
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
import { type Endpoints } from "@octokit/types";
export type IssuesList =
Endpoints["GET /repos/{owner}/{repo}/issues"]["response"]["data"];
export type Issue = IssuesList[number];
export type Label = Exclude<Issue["labels"][number], string>;
export type PaginateParams =
Endpoints["GET /repos/{owner}/{repo}/issues"]["parameters"];
export type ActionResponse = "total" | "triggered" | "skipped" | "failed";
export type ActionCounters = {
[Key in ActionResponse]: number;
};
export interface RestParams {
owner: string;
repo: string;
}
export interface WorkflowInputs {
milestone_updated?: "true" | "false";
assignee_updated?: "true" | "false";
state_updated?: "open" | "closed";
label_name?: string;
label_color?: string | null;
label_action?: "added" | "removed";
}
export interface IterateParams {
action: (issue: Issue) => Promise<ActionResponse>;
state?: PaginateParams["state"];
assignee?: PaginateParams["assignee"];
milestone?: PaginateParams["milestone"];
label_filter?: PaginateParams["labels"];
per_page?: number;
sleepMs?: number;
onlyFirstPage?: boolean;
}