You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variables can be set in many places in a Taskfile. When executing templates, Task will look for variables in the order listed below (most important first):
Variables declared in the task definition
Variables given while calling a task from another (See Calling another task above)
Global variables (those declared in the vars: option in the Taskfile)
Environment variables
Despite the fact that Environment variables are listed with the lowest priority in the docs, it seems that they are taking the highest priority over Variables declared in the task definition and Variables given while calling a task from another.
It seems like the templating within the env block has a completely different ordering, which is not shown in the docs.
This is making it difficult for me to define tasks with a static set of variables that are not overridden by the local environment. I want to do this so I can have tasks which perform operations on a specific cluster, even when run in a local env which has envvars or dotfiles pointing to a different cluster.
Description
The docs specify this ordering:
Despite the fact that
Environment variables
are listed with the lowest priority in the docs, it seems that they are taking the highest priority overVariables declared in the task definition
andVariables given while calling a task from another
.It seems like the templating within the
env
block has a completely different ordering, which is not shown in the docs.This is making it difficult for me to define tasks with a static set of variables that are not overridden by the local environment. I want to do this so I can have tasks which perform operations on a specific cluster, even when run in a local env which has envvars or dotfiles pointing to a different cluster.
Version
v3.38.0
Operating system
Linux
Experiments Enabled
No response
Example Taskfile
Example Outputs
Without an env vars set, I see:
With an env var set, I see:
The text was updated successfully, but these errors were encountered: