Skip to content

Dynamic variable execution environment does not inherit globally set environment variables #630

@kerma

Description

@kerma

It may be as designed, but it's been bugging me for a while and creates quite a bit of confusion. So if nothing else, I'll document the behavior here.

See the following example:

version: '3'
env:
  NAME: "giselle"
tasks:
  default:
    vars: 
      person:
        sh: echo $NAME
    cmds:
      - echo "Hello $NAME"
      - echo "Hello {{ .person }}"
    silent: true

Output:

Hello giselle
Hello

That makes dynamic variables a bit useless in places where you need to pass auth or other relevant info via env.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions