Skip to content

Commit

Permalink
Add support for skipped workflow state (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBoudreau committed Apr 12, 2021
1 parent 261482a commit 7163f84
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lambda/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ declare global {
| "POST_MIGRATIONS"
| "STOPPED"
| "FAILED"
| "SUCCEEDED";
| "SUCCEEDED"
| "SKIPPED";

interface GitHubActionsEvent {
state: GithubActionsEventState;
Expand Down
1 change: 1 addition & 0 deletions lambda/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum WorkflowState {
finished = "finished",
stopped = "stopped",
failed = "failed",
skipped = "skipped",
}

export const COLORS = {
Expand Down
3 changes: 2 additions & 1 deletion lambda/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const STATE_MESSAGES: { [k in keyof typeof WorkflowState]: [color: string, getSt
finished: [COLORS.success, ref => `*Finished* deploying ${ref}`],
stopped: [COLORS.warning, ref => `Deployment *stopped* for ${ref}`],
failed: [COLORS.error, ref => `Deployment *failed* for ${ref}`],
skipped: [COLORS.warning, ref => `Deployment *skipped* for ${ref}`],
};

const ENDING_STATES: WorkflowState[] = [WorkflowState.finished, WorkflowState.stopped, WorkflowState.failed];
const ENDING_STATES: WorkflowState[] = [WorkflowState.finished, WorkflowState.stopped, WorkflowState.failed, WorkflowState.skipped];

let lambdaCallback: Callback<LambdaResponse> | undefined = undefined;

Expand Down
1 change: 1 addition & 0 deletions lambda/workflows/github-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const GH_ACTIONS_EXECUTION_STATES: { [k in GithubActionsEventState]: WorkflowSta
STOPPED: WorkflowState.stopped,
FAILED: WorkflowState.failed,
SUCCEEDED: WorkflowState.finished,
SKIPPED: WorkflowState.skipped,
};

export class GithubActionsWorkflow extends Workflow<GitHubActionsEvent> {
Expand Down

0 comments on commit 7163f84

Please sign in to comment.