Skip to content

Conversation

pd93
Copy link
Member

@pd93 pd93 commented Mar 11, 2025

Fixes #2108

Including a Taskfile with a static variable works:

version: 3

includes:
  bar:
    taskfile: included.yaml
    vars:
      FOOBAR: foo

However, if you want to use an existing variable when including a Taskfile:

version: 3

vars:
  FOOBAR: foo

includes:
  bar:
    taskfile: included.yaml
    vars:
      FOOBAR: "{{.FOOBAR}}"

you're out of luck, since Task doesn't resolve variables in the include vars section. This PR adds that functionality.

Copy link
Member

@vmaerten vmaerten left a comment

Choose a reason for hiding this comment

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

Pretty straitforward

@pd93 pd93 merged commit f0414f1 into main Apr 5, 2025
14 checks passed
@pd93 pd93 deleted the 2108-process-variables-in-include-vars branch April 5, 2025 22:12
pd93 added a commit that referenced this pull request Apr 5, 2025
pd93 added a commit that referenced this pull request Apr 27, 2025
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.

Variables from included Taskfiles cannot be overwritten

3 participants