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

Updated Environment Variables Before Dotenv File #1912

Open
DominiqueLade opened this issue Nov 8, 2024 · 0 comments
Open

Updated Environment Variables Before Dotenv File #1912

DominiqueLade opened this issue Nov 8, 2024 · 0 comments
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@DominiqueLade
Copy link

I created the following task file:

vars:
  ENVIRONMENT: "dev"

dotenv: [".env.{{.ENVIRONMENT}}"]

tasks:
  ...

When executing any task normally, such as task mytask (without overwriting the variable ENVIRONMENT), everything works as expected, and the environment variables from the .env.dev file are loaded. However, when I overwrite the environment variable with task mytask ENVIRONMENT=prod, the variable is updated to prod within the task, but the .env.dev file is still loaded.

It appears that the variable is overwritten only after the dotenv file is loaded. I would expect the change to be applied beforehand. This would be highly useful for managing the environment on a global level.

  • Task version:
    • v3.40.0
  • Operating system:
    • ProductName: macOS
    • ProductVersion: 14.3
    • BuildVersion: 23D56
  • Experiments enabled:
    • no
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

2 participants