Skip to content

Commit c11e441

Browse files
committed
Bug Fix: Tighten action controls so only official event fields may be specified.
1 parent d99a7f1 commit c11e441

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lib/action.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ class Actions {
326326

327327
// allow action to specify overrides for job (i.e. from workflow action)
328328
if (action.overrides) {
329-
Tools.mergeHashInto( new_job, Tools.copyHash( action.overrides, true ) );
329+
['input', 'parent'].forEach( function(key) {
330+
if (action.overrides[key]) new_job[key] = Tools.copyHash( action.overrides[key], true );
331+
} );
330332
}
331333

332334
// if prev job had tickets, copy them over
@@ -335,9 +337,12 @@ class Actions {
335337
}
336338

337339
// allow action to specify event param overrides
338-
if (action.params) {
340+
if (action.params && event.fields) {
339341
if (!new_job.params) new_job.params = {};
340-
Tools.mergeHashInto(new_job.params, action.params);
342+
343+
event.fields.forEach( function(field) {
344+
if (field.id in action.params) new_job.params[field.id] = action.params[field.id];
345+
} );
341346
}
342347

343348
// set start node for workflows

0 commit comments

Comments
 (0)