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

BUG: variable interpolation runs twice for taskfiles that are included as a mapping #1714

Open
sprig opened this issue Jul 8, 2024 · 0 comments
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@sprig
Copy link

sprig commented Jul 8, 2024

[Edit: typo]
Hi. Thanks for this great tool!

Consider the following pair of taskfiles:

## Taskfile.yml
version: '3'

includes:
  test: test
#  test:
#    taskfile: test

and

## test/Taskfile.yml
version: '3'

vars:
  BAR: FOO/{{.BAR}}

tasks:
  foobar: echo {{.BAR}}

and run task test:foobar:

$ BAR=BAZ task test:foobar
task: [test:foobar] echo FOO/BAZ
FOO/BAZ

Looks good so far. Now uncomment the commented lines in the root taskfile above. remove the original include definition, and rerun the above test:

$ BAR=BAZ task test:foobar
task: [test:foobar] echo FOO/FOO/BAZ
FOO/FOO/BAZ

oops.

  • Task version:
$ task --version
Task version: v3.36.0 (h1:XVJ5hQ5hdzTAulHpAGzbUMUuYr9MUOEQFOFazI3hUsY=)
  • Operating system:
    linux
  • Experiments enabled:
$ task --experiments
* GENTLE_FORCE:         off
* REMOTE_TASKFILES: off
* ANY_VARIABLES:    off
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Jul 8, 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