From adc45c87db59d381294eb36ddb997e2d6872dcf0 Mon Sep 17 00:00:00 2001 From: Valentin Maerten Date: Wed, 4 Feb 2026 22:57:11 +0100 Subject: [PATCH] docs(requires): add shell command example for enum ref --- website/src/docs/guide.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/website/src/docs/guide.md b/website/src/docs/guide.md index 45fb5ecf..231ad951 100644 --- a/website/src/docs/guide.md +++ b/website/src/docs/guide.md @@ -1278,6 +1278,26 @@ tasks: - echo "Deploying to {{.ENV}}" ``` +Or generate values dynamically from a shell command: + +```yaml +version: '3' + +vars: + AVAILABLE_SERVICES: + sh: ls services/ + +tasks: + deploy: + requires: + vars: + - name: SERVICE + enum: + ref: .AVAILABLE_SERVICES | splitLines | compact + cmds: + - echo "Deploying {{.SERVICE}}" +``` + ### Prompting for missing variables interactively If you want Task to prompt users for missing required variables instead of