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
{{ message }}
Repository navigation
Dynamic variables use the wrong directory when the same Taskfile is included multiple times #2928
When the same Taskfile is included multiple times with different dir values, dynamic variables may be evaluated using the directory configured for another inclusion.
Each included task works correctly when executed separately. However, when both included tasks are executed in the same Task invocation, their dynamic-variable directory context appears to be incorrectly shared.
This is probably a duplicate of #524 and there you find a mechanism to use to avoid the issue. Its possible that the solution presented in #524 is how to solve this issue, but please continue with the PR if you want, or if the solution does not work.
This is probably a duplicate of #524 and there you find a mechanism to use to avoid the issue. Its possible that the solution presented in #524 is how to solve this issue, but please continue with the PR if you want, or if the solution does not work.
Thanks for pointing me to #524. This does appear to have the same underlying
cause: identical dynamic-variable sh: commands are reused across different
directory contexts.
In this case, the same reusable Taskfile is included twice with different dir values, so making the sh: command unique for each inclusion would be
difficult without modifying or duplicating the included Taskfile.
I'll continue investigating this. I already have a minimal failing regression
test, and I'll check whether dynamic-variable evaluation can distinguish
between different task/include directory contexts without affecting the
intended caching behavior.
Activity
trulede commentedon Jul 25, 2026
This is probably a duplicate of #524 and there you find a mechanism to use to avoid the issue. Its possible that the solution presented in #524 is how to solve this issue, but please continue with the PR if you want, or if the solution does not work.
ikshantshukla123 commentedon Jul 25, 2026
Thanks for pointing me to #524. This does appear to have the same underlying
cause: identical dynamic-variable
sh:commands are reused across differentdirectory contexts.
In this case, the same reusable Taskfile is included twice with different
dirvalues, so making thesh:command unique for each inclusion would bedifficult without modifying or duplicating the included Taskfile.
I'll continue investigating this. I already have a minimal failing regression
test, and I'll check whether dynamic-variable evaluation can distinguish
between different task/include directory contexts without affecting the
intended caching behavior.