Skip to content

Environment variables cannot reference other environment variables #2268

Open
@bravely-beep

Description

@bravely-beep

Description

After creating this Taskfile.yml:

version: "3"

env: { FOO: foo }

tasks:
  print_foobar: 
    env: { FOOBAR: { sh: echo "$FOO"bar } }
    cmd: echo "$FOOBAR"

and running task print_foobar, I get the output:

task: [print_foobar] echo "$FOOBAR"
bar

when I was expecting

task: [print_foobar] echo "$FOOBAR"
foobar

Version

3.39.2

Operating system

NixOS

Experiments Enabled

None

Example Taskfile

version: "3"

env: { FOO: foo }

tasks:
  print_foobar: 
    env: { FOOBAR: { sh: echo "$FOO"bar } }
    cmd: echo "$FOOBAR"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: envChanges related to environment variables.area: variablesChanges related to variables.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions