Add expand option when adding environment variables#5160
Conversation
|
I considered keeping the utils private by moving the code from |
|
I've put the refactoring and the flag addition in separate commits to help in review. |
|
Can this be the default behavior? IMO it's more intuitive that way. I initially assumed it worked that way. Majority of the steps of my current pipeline uses env/secret vars that need to be expanded for CLI commands so having to add the new opts for each |
See @vito's reasoning in #5001 (reply in thread). @shykes wdyt? |
ee849b9 to
a100efd
Compare
@nipuna-perera This PR adds the expand option only to - WithExec([]string{"echo", "$PATH"})
+ WithExec([]string{"sh", "-c", "echo $PATH"}) |
a100efd to
3e7366b
Compare
Ohh I misunderstood! Now, an expand on the |
3e7366b to
fcb8f39
Compare
Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
f021e34 to
15667df
Compare
Fixes #5140
Note: This only applies to
withEnvVariable.Common example is to prepend to
$PATH:In Python: