feat: add conditional execution for tasks and commands (#2564)

This commit is contained in:
Valentin Maerten
2026-01-21 23:05:40 +01:00
committed by GitHub
parent da7eb0c855
commit 9bc1efbc47
28 changed files with 444 additions and 0 deletions

View File

@@ -0,0 +1 @@
this runs

View File

@@ -0,0 +1 @@
executed

View File

@@ -0,0 +1,7 @@
task: "if-in-for-loop" started
task: [if-in-for-loop] echo "processing a"
processing a
task: [if-in-for-loop] if condition not met - skipped
task: [if-in-for-loop] echo "processing c"
processing c
task: "if-in-for-loop" finished

View File

@@ -0,0 +1,5 @@
task: "task-call-if-false" started
task: [task-call-if-false] if condition not met - skipped
task: [task-call-if-false] echo "continues after skipped task"
continues after skipped task
task: "task-call-if-false" finished

View File

@@ -0,0 +1,2 @@
subtask ran
after task call

View File

@@ -0,0 +1 @@
task: if condition not met - skipped: "task-if-false"

View File

@@ -0,0 +1 @@
task executed

View File

@@ -0,0 +1 @@
task: if condition not met - skipped: "task-level-template-false"

View File

@@ -0,0 +1 @@
task runs in prod

View File

@@ -0,0 +1 @@
both conditions met

View File

@@ -0,0 +1 @@
feature was disabled

View File

@@ -0,0 +1 @@
feature enabled

View File

@@ -0,0 +1 @@
MY_VAR is yes

View File

@@ -0,0 +1 @@
direct false skipped correctly

View File

@@ -0,0 +1 @@
direct true works

View File

@@ -0,0 +1,5 @@
task: "template-eq-false" started
task: [template-eq-false] if condition not met - skipped
task: [template-eq-false] echo "this runs"
this runs
task: "template-eq-false" finished

View File

@@ -0,0 +1 @@
env is prod

View File

@@ -0,0 +1 @@
env is not dev

View File

@@ -0,0 +1 @@
at least one condition met