-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
[BUG] Enable dotenv will make go template pipeline be invalid. #1232
Comments
+1 Well it seems more like that all taskfile defined env is simply not substituted in dynamic vars. env:
IMAGE_DIR: "HELLO"
# or
# dotenv: [".env"]
tasks:
mkdisk:
vars:
imageDir: '{{ env "IMAGE_DIR" }}'
cmds:
- echo '{{.imageDir}}' |
This is also happening to me, the following doesn't work as well: vars:
TEST: "{{.USER_WORKING_DIR | toSlash}}"
dotenv:
- ".env"
tasks:
test:
desc: "A test task"
cmds:
- echo 'This is a test!' |
This works as expected when defining vars at the task level: dotenv:
- sandwich.env
vars:
SANDWICH: '{{ env "SANDWICH" | default .DEFAULT_SANDWICH }}.sandwich'
tasks:
sandwich:
vars:
SANDWICH_PATH: '{{ joinPath .ROOT_DIR .SANDWICH_DIR .SANDWICH | osClean }}'
cmds:
- echo {{ relPath .ROOT_DIR .SANDWICH_PATH | toSlash }}
It breaks when a template pipeline is used at the global var level: dotenv:
- sandwich.env
vars:
SANDWICH: '{{ env "SANDWICH" | default .DEFAULT_SANDWICH }}.sandwich'
SANDWICH_PATH: '{{ joinPath .ROOT_DIR .SANDWICH_DIR .SANDWICH | osClean }}'
tasks:
sandwich:
cmds:
- echo {{ relPath .ROOT_DIR .SANDWICH_PATH | toSlash }}
|
I took some times to investigate this. |
How to reproduce it?
When I don't include dotenv key in config file, all things work well:
But when I add
dotenv
keys in config file with an empty.env
file(created but no content):then run task again and the console will show:
The text was updated successfully, but these errors were encountered: