Skip to content

Commit

Permalink
fix: allow selective override of keys in inputs field in the workfl…
Browse files Browse the repository at this point in the history
…ow file when using `setInput` (#64)

Co-authored-by: Sam Peddamatham <[email protected]>
  • Loading branch information
im-sampm and im-sampm-demo authored Jan 12, 2024
1 parent 74b85dc commit 83ce2b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/action-input/action-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ export class ActionInput {
toActArguments() {
if (Object.keys(this.event.event).length > 0) {
const eventCopy = { ...this.event.event };
eventCopy.inputs = Object.fromEntries(this.input.map);
// Merge inputs with existing event entries
eventCopy.inputs = {
...(eventCopy.inputs || {}),
...Object.fromEntries(this.input.map)
};
this.event.event = eventCopy;
return [];
} else {
return this.input.toActArguments();
}
}
}
}

0 comments on commit 83ce2b3

Please sign in to comment.