-
-
Notifications
You must be signed in to change notification settings - Fork 639
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
Feature: Dynamically added env variables #1786
Comments
This is possible to set dynamic env variable but only one at the same time : version: '3'
tasks:
greet:
env:
GREETING: {sh: echo 'hello'}
FOO: bar
cmds:
- echo $GREETING If you want to add multiple env variable at the same time, I would use |
Even if
|
+1 My use case is that I'd like to dynamically define $A or $B from a script depending on what's available in the environment. I implemented this logic as well as a bunch of other checks as an internal task and exported the appropriate variable for use in subsequent commands. Obviously, this didn't end up working as exported variables aren't visible to other commands. It would be nice to be able to affect the 'global task environment' in some way from within tasks. There are other methods to achieve what I'm doing, but they subvert Task's features rather than synergize with them. Another use case: exporting environment variables from Task into the shell environment. Running I think there's a lot of value in Task's sandboxing of environment variables, but it would be nice to have an escape hatch. Maybe something a la Github Action's |
I'd like to have some option to set env variables dynamically for all steps of the task.
Example 1:
Example 2:
Without the feature I have to export variables and use them in one step - example:
Example 2:
The text was updated successfully, but these errors were encountered: