Skip to content

Commit

Permalink
Add support for repository_dispatch event
Browse files Browse the repository at this point in the history
This adds support for repository_dispatch event in workflows.
  • Loading branch information
beagleknight committed Aug 22, 2023
1 parent 0741358 commit d612bce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export type EventName =
| "workflow_run"
| "workflow_dispatch"
| "schedule"
| "pull_request_target";
| "pull_request_target"
| "repository_dispatch"

export type EventOptions<T extends EventName> = T extends "push"
? PushEventOptions
Expand All @@ -19,6 +20,8 @@ export type EventOptions<T extends EventName> = T extends "push"
? WorkflowDispatchEventOptions
: T extends "schedule"
? ScheduleEventOptions
: T extends "repository_dispatch"
? RepositoryDispatchEventOptions
: never;

interface PushEventOptions {
Expand Down Expand Up @@ -56,6 +59,10 @@ interface WorkflowDispatchEventOptions {

type ScheduleEventOptions = Array<{ cron: string }>;

interface RepositoryDispatchEventOptions {
types: string[]
}

export interface Event {
name: EventName;
options?: EventOptions<EventName>;
Expand Down

0 comments on commit d612bce

Please sign in to comment.