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

requires.env seem to run before dotenv files are loaded #1362

Open
G07cha opened this issue Oct 6, 2023 · 0 comments
Open

requires.env seem to run before dotenv files are loaded #1362

G07cha opened this issue Oct 6, 2023 · 0 comments
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@G07cha
Copy link

G07cha commented Oct 6, 2023

  • Task version: 3.30.1
  • Operating system: MacOS
  • Experiments enabled: No

First of all, thanks for making such a neat tool, I found it very easy migrating to go-task from my archaic bash scripts. I did, however, run it one small issue with requires.env and dotenv task properties. When I load a variable from one of the files defined in dotenv array and try to verify that it's present by specifying it in requires.env it fails regardless if the variable is present in env file or not. This only happens when both properties are defined on a task level, when dotenv is defined at the root the check works as expected.

# Taskfile.yml
version: '3'

tasks:
  fail:
    dotenv: ['.env']
    requires:
      vars: [FOO]
    cmds:
      - echo "Works"
# .env
FOO="BAR"
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Oct 6, 2023
yordis added a commit to yordis/task that referenced this issue Oct 29, 2023
yordis added a commit to yordis/task that referenced this issue Oct 29, 2023
yordis added a commit to yordis/task that referenced this issue Oct 29, 2023
yordis added a commit to yordis/task that referenced this issue Oct 29, 2023
yordis added a commit to yordis/task that referenced this issue Oct 29, 2023
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

Successfully merging a pull request may close this issue.

2 participants