T
Task3w ago
kobbs9

dotenv inside included Taskfile

From docs: "Please note that you are not currently able to use the dotenv key inside included Taskfiles." Are there any plans to implement this, please? Especially when using dotenv on task level in included Taskfile works: included Taskfile:
show:
dotenv: ['.env']
desc: show
cmd: echo $VAL_FROM_ENV
show:
dotenv: ['.env']
desc: show
cmd: echo $VAL_FROM_ENV
I am trying to use Taskfile in monorepo where "apps" have their own .env in their context (folders) as well as a Taskfile. Thanks.
2 Replies
pd93
pd933w ago
Hi @kobbs9. Issue for this is https://github.com/go-task/task/issues/1075. Also see this comment
GitHub
Ability to use the dotenv key inside included Taskfiles · Issue #10...
Currently the dotenv key cannot be used inside included Taskfiles. Doing so gives the following error: Included Taskfiles can't have dotenv declarations. Please, move the dotenv declaration to ...
GitHub
feat: add task-level dotenv support by pd93 · Pull Request #904 · g...
This PR adds support for the task-level dotenv key - A much requested feature. The key works much the same as it does at a global level: version: '3' tasks: default: dotenv: ...
kobbs9
kobbs9OP3w ago
Thank you

Did you find this page helpful?