Skip to content

unable to template 'internal' field of task #2769

@Diaphteiros

Description

@Diaphteiros

Description

I would like to dynamically hide some tasks, depending on some variable's value. But it seems that the result is always a string - which is rejected by the task's internal field - even if the resulting value is a bool.

err:  cannot unmarshal !!str `{{ eq (...` into bool

Version

3.48.0

Operating system

macOS

Experiments Enabled

No response

Example Taskfile

version: 3

tasks:
  foo: # this task should only be visible if FOO is not empty
    desc: Print FOO
    cmds:
    - 'echo {{ .FOO }}'
    internal: '{{ eq ( .FOO | default "" ) "" }}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions