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

Var containing var to be replaced later? #1552

Open
leobenkel opened this issue Mar 15, 2024 · 0 comments
Open

Var containing var to be replaced later? #1552

leobenkel opened this issue Mar 15, 2024 · 0 comments
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@leobenkel
Copy link

leobenkel commented Mar 15, 2024

so imagine the main Taskfile and a child child.Taskfile.yml:

child.Taskfile.yml:

version: '3'
#...

tasks:
#...
   vars:
        FOO: "{{.FOO | default '' }}"
   cmds:
      - {{DO_SOMETHING}}

so the parent might want to do something like:

Taskfile.yml

#...

includes:
  utils:
    taskfile: child.Taskfile.yml
    vars:
       DO_SOMETHING: echo "{{.FOO}}"
#...

That way when the child task is called, it can leverage the locally available variable.

From my experiment, and that make sense, FOO is being replaced before it is available.
I have also tried DO_SOMETHING: echo "\{\{.FOO\}\}" in the hope it would be evaluated later but no luck.

Is that possible today?

specifically useful to handle utilities for aws queries that might have dynamic arguments

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Mar 15, 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