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