mirror of
https://github.com/go-task/task.git
synced 2026-02-24 20:20:30 +01:00
Add support for referencing variables in enum validation:
```yaml
vars:
ALLOWED_ENVS: ["dev", "staging", "prod"]
tasks:
deploy:
requires:
vars:
- name: ENV
enum:
ref: .ALLOWED_ENVS
```
This allows enum values to be defined once and reused, or computed
dynamically using template expressions like `| fromYaml`.
Changes:
- Add Enum type with Ref/Value fields in taskfile/ast/requires.go
- Add resolveEnumRefs() to resolve refs at task compilation time
- Add getEnumValues() helper in requires.go
- Only resolve enum refs when shell variables are evaluated