@factorialco/gat
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,3 +0,3 @@ | ||
export declare type EventName = "push" | "pull_request" | "pull_request_review" | "workflow_run"; | ||
export declare type EventOptions<T extends EventName> = T extends "push" ? PushEventOptions : T extends "pull_request" ? PullRequestEventOptions : T extends "pull_request_review" ? PullRequestReviewEventOptions : T extends "workflow_run" ? WorkflowRunEventOptions : never; | ||
export declare type EventName = "push" | "pull_request" | "pull_request_review" | "workflow_run" | "workflow_dispatch"; | ||
export declare type EventOptions<T extends EventName> = T extends "push" ? PushEventOptions : T extends "pull_request" ? PullRequestEventOptions : T extends "pull_request_review" ? PullRequestReviewEventOptions : T extends "workflow_run" ? WorkflowRunEventOptions : T extends "workflow_dispatch" ? WorkflowDispatchEventOptions : never; | ||
interface PushEventOptions { | ||
@@ -18,2 +18,11 @@ branches?: string[]; | ||
} | ||
interface WorkflowDispatchInput { | ||
description: string; | ||
required?: boolean; | ||
type?: "choice" | "boolean"; | ||
options?: string[]; | ||
} | ||
interface WorkflowDispatchEventOptions { | ||
inputs?: Record<string, WorkflowDispatchInput>; | ||
} | ||
export interface Event { | ||
@@ -20,0 +29,0 @@ name: EventName; |
@@ -165,2 +165,23 @@ "use strict"; | ||
}); | ||
(0, vitest_1.it)("support workflow dispatch event", () => { | ||
const workflow = new workflow_1.Workflow("Workflow dispatch"); | ||
workflow | ||
.on("workflow_dispatch", { | ||
inputs: { | ||
foo: { | ||
description: "A foo input", | ||
required: true, | ||
}, | ||
bar: { | ||
description: "A bar input", | ||
type: "choice", | ||
options: ["bar", "baz"], | ||
}, | ||
}, | ||
}) | ||
.addJob("job1", { | ||
steps: [{ name: "Do something", run: "exit 0" }], | ||
}); | ||
(0, vitest_1.expect)(workflow.compile()).toMatchSnapshot(); | ||
}); | ||
}); |
{ | ||
"name": "@factorialco/gat", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "TODO", | ||
@@ -5,0 +5,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17196
446