Skip to content
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

dotenv files are loaded before task dependencies are ready #1381

Open
grishasergii opened this issue Oct 27, 2023 · 0 comments · May be fixed by #1746
Open

dotenv files are loaded before task dependencies are ready #1381

grishasergii opened this issue Oct 27, 2023 · 0 comments · May be fixed by #1746
Labels
area: env Changes related to environment variables. type: enhancement A change to an existing feature or functionality.

Comments

@grishasergii
Copy link

Consider the following example where make-env task produces a .env file and my-task task depends on make-env and loads .env. I would expect to see MY_VAR = MY_VALUE after running the task my-task command, but it is MY_VAR = instead. It seems like it loads the dotenv file first (but does not fail because the file does not exist yet?) and then executes all dependencies.

---
version: 3

tasks:
  make-env:
    cmds:
      - echo "MY_VAR=MY_VALUE" >> ./.env
  my-task:
    deps:
      - make-env
    dotenv:
      - ./.env
    cmds:
      - echo "MY_VAR = $MY_VAR"
  • Task version: v3.31.0 (h1:o6iyj9gPJXxvxPi/u/l8e025PmM2BqKgtLNPS2i7hV4=)
  • Operating system: macOS 13.6 (22G120)
  • Experiments enabled: no
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Oct 27, 2023
@vmaerten vmaerten added type: enhancement A change to an existing feature or functionality. area: env Changes related to environment variables. and removed state: needs triage Waiting to be triaged by a maintainer. labels Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: env Changes related to environment variables. type: enhancement A change to an existing feature or functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants