Skip to content

Conversation

@vmaerten
Copy link
Member

@vmaerten vmaerten commented Feb 4, 2026

No description provided.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant