-
-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vars don't get properly propagated with two levels of included
nesting
#996
Comments
I have the same issue, which I reduced to the following three task files: # ./Taskfile.yml
version: '3'
includes:
foo:
taskfile: ./foo/Taskfile.yml
# ./foo/Taskfile.yml
version: '3'
includes:
bar:
vars:
N: '3'
PREFIX: 'prefix-'
taskfile: ./Taskfile.include.yml
# ./foo/Taskfile.include.yml
version: '3'
vars:
N: '{{.N | default "1"}}'
env:
N_ENV: '{{.N}}'
tasks:
baz:
cmds:
- echo N {{.N}}
- echo PREFIX {{.PREFIX}}
When running from the top level, the specified variables aren't used:
But when running from the second level, they are used:
|
This looks like a straight up bug to me. I've not played with this code at all, but assuming I could find some spare time, does this look like something that is unlikely to break other behaviour if fixed? Fixing this would really simplify some of our taskfiles so I'm keen to take a look at it (again assuming my mythical "free time" can be organised). |
Hello,
thanks for the amazing tool that Taskfile is. I have a bit of advanced use case, so bear with me.
I am facing an issue with the current setup:
C_VARIABLE: '{{.C_VARIABLE | default "localhost"}}'
this is the content of A.Taskfile.yml:
this is the content of B.Taskfile.yml:
and this is the content of C.Taskfile.yml
If I run the following command it behaves as expected. Meaning that when B:up calls C:up, it overrides the variable C_VARIABLE with the content of B_variable=b
if instead I run the same up task from A
the C_VARIABLE is not overridden but it uses the default value instead.
This is not what I was expecting
Am I doing something wrong? Do I have wrong expectations or is this a bug?
The text was updated successfully, but these errors were encountered: