Skip to content

Commit 2608b82

Browse files
committed
update docs
1 parent 1948a82 commit 2608b82

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

docs/resources/workflow.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ resource "devhub_workflow" "example" {
4040
}
4141
},
4242
{
43-
name = "slack-step"
43+
name = "condition-step"
44+
45+
condition_action = {
46+
condition = "$${user_id} == '123'"
47+
when_false = "failed"
48+
}
49+
},
50+
{
51+
name = "slack-step"
52+
condition = "$${user_id} == '123'"
4453
4554
slack_action = {
4655
slack_channel = "my-channel"
@@ -86,6 +95,7 @@ resource "devhub_workflow" "example" {
8695

8796
### Optional
8897

98+
- `cron_schedule` (String) A cron expression evaluated using UTC time to trigger the workflow (e.g. 0 0 * * *).
8999
- `inputs` (Attributes List) (see [below for nested schema](#nestedatt--inputs))
90100
- `trigger_linear_label_name` (String) The name of the Linear label that should trigger the workflow.
91101

@@ -100,6 +110,8 @@ Optional:
100110

101111
- `api_action` (Attributes) (see [below for nested schema](#nestedatt--steps--api_action))
102112
- `approval_action` (Attributes) (see [below for nested schema](#nestedatt--steps--approval_action))
113+
- `condition` (String) Expression to evaluate if this step should run, if evaluated as true step will run, otherwise it will be skipped. If no condition is set the step will always run. You can use the input, output from previous steps, and basic operators like ==, !=, >, <, >=, <=, &&, ||, not.
114+
- `condition_action` (Attributes) (see [below for nested schema](#nestedatt--steps--condition_action))
103115
- `name` (String) The name of the step.
104116
- `query_action` (Attributes) (see [below for nested schema](#nestedatt--steps--query_action))
105117
- `slack_action` (Attributes) (see [below for nested schema](#nestedatt--steps--slack_action))
@@ -163,6 +175,15 @@ Read-Only:
163175

164176

165177

178+
<a id="nestedatt--steps--condition_action"></a>
179+
### Nested Schema for `steps.condition_action`
180+
181+
Required:
182+
183+
- `condition` (String) Expression to evaluate if workflow should continue, if evaluated as true workflow will continue. You can use the input, output from previous steps, and basic operators like ==, !=, >, <, >=, <=, &&, ||, not.
184+
- `when_false` (String) When false, mark workflow as: (failed, succeeded)
185+
186+
166187
<a id="nestedatt--steps--query_action"></a>
167188
### Nested Schema for `steps.query_action`
168189

examples/resources/devhub_workflow/resource.tf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,16 @@ resource "devhub_workflow" "example" {
2525
}
2626
},
2727
{
28-
name = "slack-step"
28+
name = "condition-step"
29+
30+
condition_action = {
31+
condition = "$${user_id} == '123'"
32+
when_false = "failed"
33+
}
34+
},
35+
{
36+
name = "slack-step"
37+
condition = "$${user_id} == '123'"
2938

3039
slack_action = {
3140
slack_channel = "my-channel"

0 commit comments

Comments
 (0)