Skip to content

Commit

Permalink
複数のトリガーをオブジェクト形式で指定できなかったので修正
Browse files Browse the repository at this point in the history
  • Loading branch information
happy-tanuki committed Sep 10, 2023
1 parent b09b901 commit 8e709b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/triggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ export function parseTrigger(on: any): WorkflowTriggerMap {
if (Array.isArray(on)) {
return on.reduce((obj, o) => ({ ...obj, ...parseTrigger(o) }), {});
} else if (typeof on === 'object') {
Object.keys(on).forEach((k) => {
if (typeof on[k] === 'object') {
// valid
} else if (on[k] === null || on[k] === true) {
on[k] = {}; // fix to {}
} else {
delete on[k]; // invalid
}
});
return on;
} else if (typeof on === 'string') {
return { [on]: {} };
Expand Down

0 comments on commit 8e709b8

Please sign in to comment.