millerovtr
millerovtr
TTask
Created by millerovtr on 1/27/2025 in #help
How to define global variables for all taskfiles
Hello. Could you please help me. I can't find a way how to define global variables for all Taskfiles. I have a lot of Taskfiles and want to define some "user-defined" variables that will be applied for all Taskfiles, but can't find a way how to do it. I tried to create some Taskfile
version: '3'

vars:
VAR1: value1
VAR2: value2
VAR3: value3
version: '3'

vars:
VAR1: value1
VAR2: value2
VAR3: value3
and include it to all other Taskfiles
includes:
config:
taskfile: ./cfg/config.yml
flatten: true
includes:
config:
taskfile: ./cfg/config.yml
flatten: true
but it looks like variables doesn't propagated with this way. Do we have some other way how to define set of variables in separate file and include them to Taskfile? Or maybe some way how to define global variables? Thank you for your support!
3 replies