fix: evaluate task-level if condition after resolving dynamic variables by vmaerten · Pull Request #2660 · go-task/task

added 2 commits

January 25, 2026 19:40
Move the prompt for required variables AFTER the if condition check.
This avoids asking the user for input when the task won't run anyway.

The order in RunTask() is now:
1. FastCompiledTask
2. Check required vars early (non-interactive mode only)
3. CompiledTask (resolve dynamic vars)
4. Check if condition → exit early if false
5. Prompt for missing vars (only if task will run)
6. Validate required vars

@vmaerten vmaerten marked this pull request as ready for review

January 25, 2026 19:51

andreynering

Copilot AI pushed a commit to libor-m/task that referenced this pull request

Mar 27, 2026
Co-authored-by: libor-m <1497769+libor-m@users.noreply.github.com>