Skip to content

Allow overriding of global variable default at the task level #2025

@luiavila

Description

@luiavila

Description

Example situation:

By default, the global variable default should be used. If a task defines / attempts to override the default, it is currently not utilized.

version: '3'

vars:
  MY_VAR: '{{.MY_VAR | default 123}}'

tasks:
  MY_TASK:
    vars:
      MY_VAR: '{{.MY_VAR | default 456}}'
    cmds:
      - echo "MY_VAR = {{.MY_VAR}}"

Current output:

> task MY_TASK
MY_VAR = 123

> task MY_TASK MY_VAR=789
MY_VAR = 789

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions