Skip to content

set: options don't apply to dynamically (shell) expanded variables #1901

@WinkelCode

Description

@WinkelCode
version: "3"

set:
  - pipefail

tasks:
  default:
    vars:
      TESTVAR:
        sh: |-
          false | true
          echo "test"
    cmds:
      - |-
        false | true
        echo "Testing {{.TESTVAR}}"

When pipefail is enabled, the task command fails, but the TESTVAR expansion does not.

$ task -v
task: [REDACTED] Not found - Using alternative (Taskfile.yml)
task: dynamic variable: "false | true\necho \"test\"" result: "test"
task: "default" started
task: [default] false | true
echo "Testing test"
task: Failed to run task "default": exit status 1
  • Task version:
$ task --version
Task version: 3.39.2 ()
  • Operating system: macOS Sequoia 15.1
  • Experiments enabled: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions