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

fix: expand task-level dotenv in brackets #1627

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aminya
Copy link
Contributor

@aminya aminya commented Apr 28, 2024

Fixes #997

Task level dotenv didn't expand the variables referenced by {{.var}} previously This fixes the issue. I added a test for it to prevent the bug from happening again.

Comment on lines 8 to +19
dotenv: ['.env']
cmds:
- echo "$FOO" > dotenv.txt
- echo "{{.FOO}}" > dotenv-2.txt
- task: dotenv_called
vars:
FOO: "{{.FOO}}"

dotenv_called:
cmds:
- echo "$FOO" > dotenv-called.txt
- echo "{{.FOO}}" > dotenv-called-2.txt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this PR, this variable forwarding finally works. There's still room for improvement if the dotenv vars should be automatically propagated to any underlying task. But that could be handled separately.

@chimbori
Copy link

chimbori commented Jun 2, 2024

This PR solves an issue I am running into (thank you @aminya)!

For the maintainers: is there a plan or timeline for when this will be merged? Or is there another action required here before it can be considered ready? Thank you!

@dmitry-mightydevops
Copy link

can someone review and merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotenv not working at task level
3 participants