Skip to content

Lazy global dynamic variable #1240

Open
@lockieluke

Description

@lockieluke

Only load global variables with SH when the task needs it:

version: '3'
vars:
  MESSAGE:
    sh: sleep 5 && echo "WORLD"

tasks:
  print:
    cmds:
      - echo "HELLO {{.MESSAGE}}"

  print-no-wait:
    cmds:
      - echo "PRINT THIS INSTANTLY"

Other tasks that don't need the variable should not have it loaded

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