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

YAML merge key << doesn't work #1705

Closed
simonrouse9461 opened this issue Jul 2, 2024 · 1 comment
Closed

YAML merge key << doesn't work #1705

simonrouse9461 opened this issue Jul 2, 2024 · 1 comment
Labels
state: invalid This doesn't seem right.

Comments

@simonrouse9461
Copy link

simonrouse9461 commented Jul 2, 2024

I'm trying to use yaml anchors with merge key in the taskfile:

version: '3'
 
anchors: &vars
  A: 1
  B: 2

vars:
  << : *vars

tasks:
  default:
    cmd: echo {{.A}} {{.B}}

Here's the error message:

err:  "A" is not a valid variable type. Try "sh", "ref", "map" or using a scalar value
file: .../Taskfile.yml:3:10
  1 | version: '3'
  2 |  
> 3 | anchors: &vars
    |          ^
  4 |   A: 1
  5 |   B: 2

It looks like the anchor works but the merge key doesn't. It treated the merge key as an actual key.

  • Task version: 3.38.0
  • Operating system: MacOS Sonoma
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Jul 2, 2024
@andreynering andreynering added state: invalid This doesn't seem right. type: question Further information is requested. and removed state: needs triage Waiting to be triaged by a maintainer. labels Jul 2, 2024
@andreynering
Copy link
Member

Hi @simonrouse9461,

YAML anchors are not supported in Task. They are not easy to get working right with Task's complex schema.

@andreynering andreynering closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@pd93 pd93 removed the type: question Further information is requested. label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: invalid This doesn't seem right.
Projects
None yet
Development

No branches or pull requests

4 participants