Open simonrouse9461 opened 3 months ago
This won't work either:
version: '3'
dotenv:
- .env
includes:
test_import:
taskfile: '{{.ENV_NAME}}.yml'
tasks:
test:
cmds:
- echo {{.ENV_NAME}}
where .env file contains:
ENV_NAME=my_env
I see similar behaviour with the special variables too
❯ ll
total 8.0K
-rw-r--r-- 1 chris chris 285 Jul 2 23:05 LocalTaskfile.yml
-rw-r--r-- 1 chris chris 176 Jul 2 23:06 Taskfile.yml
❯ cat Taskfile.yml
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
includes:
local:
taskfile: "{{.USER_WORKING_DIR}}/LocalTaskfile.yml"
# optional: true
❯ task --list-all
stat /LocalTaskfile.yml: no such file or directory
Task version: v3.38.0 (h1:O7kgA6BfwktXHPrheByQO46p3teKtRuq1EpGnFxNzbo=) Operating system: "Ubuntu 22.04.4 LTS (on WSL2) Experiments enabled: N/A
Indeed dynamic variables and special variables are not evaluated before the include
Taskfile:
This will fail with:
It seems that
ENV_NAME
evaluates to an empty string inside test_import.