-
Notifications
You must be signed in to change notification settings - Fork 41
ExportAs has no effect in case the environment variable already exists #88
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hello,
I am trying to set an environment variable with a specific name as task output and re-using the environment variable in subsequent task of a pipeline.
If an environment variable with the exact same name already exists in the environment, then the exportAs seems to have no effect, i.e. it has the external value. Is this expected behavior?
It can be reproduce with the following taskctl.yml file
tasks:
set-var-value:
command:
- printf "var-value-changed"
exportAs: VAR_NAME
use-var-value:
command:
- printf "${VAR_NAME}"
pipelines:
test-export-as-override:
- task: set-var-value
- task: use-var-value
depends_on: get-var-value
If the pipeline is run in the following way:
export VAR_NAME=var-value-original
taskctl test-export-as-override
INFO[0000] Running task set-env-value...
set-env-value: var-value-changed
INFO[0000] set-env-value finished. Duration 200.544µs
INFO[0000] Running task use-env-value...
use-env-value: var-value-original
INFO[0000] use-env-value finished. Duration 151.547µs
Summary:
- Stage set-env-value was completed in 426.211µs
- Stage use-env-value was completed in 482.525µs
Total duration: 100.584622ms
The use-env-value: var-value-original shows that the exportAs did not have any effect.
I use the following taskctl version on Ubuntu 20.04.2 LTS
taskctl -version
taskctl version 1.4.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working