Created
February 27, 2019 08:56
-
-
Save nzlosh/375631a06536faa1a85056b90a908326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: conditional_action | |
pack: test | |
description: "Executes the action based on run_action parameter." | |
runner_type: orquesta | |
entry_point: workflow/conditional_action.yaml | |
enabled: True | |
parameters: | |
run_action: | |
required: true | |
type: string | |
default: "action1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: 1.0 | |
description: "Executes the action based on run_action parameter." | |
input: | |
- run_action | |
tasks: | |
select_action: | |
action: core.noop | |
next: | |
- | |
when: <% ctx("run_action") = "action1" %> | |
do: action1 | |
- | |
when: <% ctx("run_action") = "action2" %> | |
do: action2 | |
- | |
when: <% not ctx("run_action") in ["action1", "action2"] %> | |
do: error | |
action1: | |
action: core.local | |
input: | |
cmd: echo "You have run action1" | |
action2: | |
action: core.local | |
input: | |
cmd: echo "You have run action2" | |
error: | |
action: core.local | |
input: | |
cmd: echo "Error - unsupported action" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment