Skip to content

Commit 66a67af

Browse files
author
Yang Guo
committed
fix inputs from step yaml should has top pritory
1 parent 696cb99 commit 66a67af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/java/com/flowci/core/job/manager/CmdManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ public CmdId createId(Job job, StepNode node) {
4747
@Override
4848
public CmdIn createShellCmd(Job job, StepNode node) {
4949
CmdIn cmd = new CmdIn(createId(job, node).toString(), CmdType.SHELL);
50-
cmd.setInputs(job.getContext()); // yml env was in the job context
5150
cmd.setFlowId(job.getFlowId()); // default work dir is {agent dir}/{flow id}
5251
cmd.setDocker(node.getDocker());
5352

53+
// set inputs from step yaml env and job context, step yaml env has top priority
54+
cmd.getInputs().merge(job.getContext()).merge(node.getEnvironments());
55+
5456
cmd.addScript(node.getScript());
5557
cmd.addEnvFilters(node.getExports());
5658

0 commit comments

Comments
 (0)