@factorialco/gat 0.0.8 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/event.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- export declare type EventName = "push" | "pull_request" | "pull_request_review" | "workflow_run" | "workflow_dispatch";
2
- 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;
1
+ export declare type EventName = "push" | "pull_request" | "pull_request_review" | "workflow_run" | "workflow_dispatch" | "schedule";
2
+ 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 : T extends "schedule" ? ScheduleEventOptions : never;
3
3
  interface PushEventOptions {
4
4
  branches?: string[];
5
5
  paths?: string[];
6
6
  }
7
7
  interface PullRequestEventOptions {
8
- types?: Array<"opened" | "reopened" | "synchronize" | "labeled" | "unlabeled">;
8
+ branches?: string[];
9
9
  paths?: string[];
10
+ types?: Array<"opened" | "reopened" | "synchronize" | "labeled" | "unlabeled">;
10
11
  }
11
12
  interface PullRequestReviewEventOptions {
12
13
  types?: Array<"submitted">;
@@ -24,6 +25,9 @@ interface WorkflowDispatchInput {
24
25
  interface WorkflowDispatchEventOptions {
25
26
  inputs?: Record<string, WorkflowDispatchInput>;
26
27
  }
28
+ declare type ScheduleEventOptions = Array<{
29
+ cron: string;
30
+ }>;
27
31
  export interface Event {
28
32
  name: EventName;
29
33
  options?: EventOptions<EventName>;
package/dist/step.d.ts CHANGED
@@ -4,6 +4,7 @@ export interface BaseStep {
4
4
  env?: Record<string, string>;
5
5
  ifExpression?: string;
6
6
  workingDirectory?: string;
7
+ continueOnError?: boolean;
7
8
  }
8
9
  export declare type Step = RunStep | UseStep;
9
10
  export interface RunStep extends BaseStep {
package/dist/workflow.js CHANGED
@@ -77,10 +77,11 @@ class Workflow {
77
77
  }
78
78
  : undefined,
79
79
  env,
80
- steps: steps.map(({ id, name, ifExpression, workingDirectory, ...options }) => ({
80
+ steps: steps.map(({ id, name, ifExpression, workingDirectory, continueOnError, ...options }) => ({
81
81
  id,
82
82
  name,
83
83
  if: ifExpression,
84
+ "continue-on-error": continueOnError,
84
85
  "working-directory": workingDirectory,
85
86
  ...options,
86
87
  })),
@@ -183,4 +183,12 @@ const workflow_1 = require("./workflow");
183
183
  });
184
184
  (0, vitest_1.expect)(workflow.compile()).toMatchSnapshot();
185
185
  });
186
+ (0, vitest_1.it)("supports schedule event", () => {
187
+ const workflow = new workflow_1.Workflow("Schedule")
188
+ .on("schedule", [{ cron: "0 4 * * 1-5" }])
189
+ .addJob("job1", {
190
+ steps: [{ name: "Do something", run: "exit 0" }],
191
+ });
192
+ (0, vitest_1.expect)(workflow.compile()).toMatchSnapshot();
193
+ });
186
194
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/gat",
3
- "version": "0.0.8",
3
+ "version": "0.0.11",
4
4
  "description": "TODO",
5
5
  "bin": {
6
6
  "gat": "dist/cli.js"