fix: Call ReplaceVars() to resolve Ref's for imported global vars. (#2632)

This commit is contained in:
Timothy Rule
2026-02-18 18:55:20 +01:00
committed by GitHub
parent 56b316a124
commit 2cdd7d3e43
4 changed files with 24 additions and 0 deletions

View File

@@ -2,6 +2,9 @@ version: '3'
vars:
GLOBAL_VAR: [1, 2, 2, 2, 3, 3, 4, 5]
GLOBAL_FOO:
ref: .GLOBAL_BAR
GLOBAL_BAR: bar
tasks:
default:
@@ -9,6 +12,7 @@ tasks:
- task: ref-dep
- task: ref-resolver
- task: ref-resolver-sh
- task: ref-global
ref-cmd:
vars:
@@ -72,3 +76,13 @@ tasks:
{{- else}} and {{$child.name -}}
{{- end -}}
{{- end -}}"
ref-global:
vars:
TASK_FUBAR:
ref: .GLOBAL_FOO
cmds:
- echo "GLOBAL_FOO={{.GLOBAL_FOO}}"
- echo "GLOBAL_BAR={{.GLOBAL_BAR}}"
- echo "TASK_FUBAR={{.TASK_FUBAR}}"
silent: true

View File

@@ -0,0 +1,3 @@
GLOBAL_FOO=bar
GLOBAL_BAR=bar
TASK_FUBAR=bar