-
-
Notifications
You must be signed in to change notification settings - Fork 551
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
Vars can be included in other vars, but env vars not in other env vars #1615
Comments
Looking through the code ... my take: Case 1; Works. Vars are processed in order, so later vars can reference earlier vars (resolved from a cache). This is I think, normal. Case 2; When a task is compiled dynamic variables (i.e sh commands) are resolved based on the calling environment and emitted to the compiled task (which is then run). It might be possible to change that behaviour by adding an ongoing cache of the compiled env to the Compile object, and then use that cache here execext.RunCommandOptions. Case 3; Here the situation is a bit easier. Env's are compiled before vars ... so what you try to do cannot work (on the first pass). On the second run, the var is (likely) found in a cache, and so that second attempt appears to work. My take on the documentation is that it explains what works, which is sufficient. Assumed functionality should be avoided. Case 2 is interesting. But is there are reason to do that? It could be better to set SECRET_NAME in the calling environment, or when calling task. |
Vars can be included in other vars
Env vars can not be included in other env vars
Vars can kind of be included in env vars
This does not work on the first try, but is executed twice and works on the second try:
I guess that this behavior is intended? If so, it would be great to document this on the "Usage" web page (and maybe discourage people from doing the third thing).
I could provie a PR if you'd like.
The text was updated successfully, but these errors were encountered: