-
-
Notifications
You must be signed in to change notification settings - Fork 725
Labels
area: requiresarea: templatingChanges related to the templating engine.Changes related to the templating engine.area: variablesChanges related to variables.Changes related to variables.
Description
This could be the exact same, or similar issue as #1557, but there is no reproduction happening there, so I decided to make a new issue, because I found a way to reproduce the "requires" breakage. The required variable is not enforced in the below example.
Expected: "task: Task "default" cancelled because it is missing required variables: MY_VAR"
Result: "template: :1:28: executing "" at <" ">: invalid value; expected string"
Taskfile:
version: 3
tasks:
default:
requires:
vars: [MY_VAR]
cmd: |
{{range .MY_VAR | splitList " " }}
{{end}}
When not using the template function, the required variable feature works as expected.
Result: "task: Task "default" cancelled because it is missing required variables: MY_VAR"
version: 3
tasks:
default:
requires:
vars: [MY_VAR]
cmd: |
{{range .MY_VAR }}
{{end}}
- Task version: v3.40.0
- Operating system: Linux, macOS
- Experiments enabled: no
Metadata
Metadata
Assignees
Labels
area: requiresarea: templatingChanges related to the templating engine.Changes related to the templating engine.area: variablesChanges related to variables.Changes related to variables.