Add if-else paths to the workflow

From Anonymous on 2016/02/26 17:35:57 +0000

This feature would enable us to create a workflow in which, if a step failed a workflow branch is followed, while if the step succeeded another branch is followed.

Copied from original feature request: http://bitrise.uservoice.com/forums/235233-general/suggestions/12489012-add-if-else-paths-to-the-workflow

From Callum Taylor on 2016/09/22 10:32:53 +0000

+1 I'd like this also, we want the ability to trigger a "submission" workflow given a certain parameter, without having to duplicate whole workflows

From Anonymous on 2016/03/19 01:22:39 +0000

I would like to support the idea too.
I need something is General (I put it at the end of stack) that tells me the Build process (including tests) had been successful or not. Then I'll send correct message to Phabricator.

From Bitrise on 2016/03/16 10:05:49 +0000

In general you can use "run_if" to only run a Step based on the build's status: https://github.com/bitrise-io/bitrise/blob/master/_examples/experimentals/templates/bitrise.yml#L80

E.g. if you want to run a step only if the build failed: run_if: .IsBuildFailed, or if you want to only run it if the build was successful (which is the default unless is_always_run: true is set, so you don't even need a run_if): run_if: not .IsBuildFailed OR is_always_run: false

From Flo on 2016/03/16 09:31:06 +0000

I'd like to support that idea.
Essentially what this would enable us to do is sending a message to Slack only if a build (or e.g. a unit test) fails, to prevent spamming the Slack channel.

@viktorbenei

I’m a bit confused. Is this possible yet? This seems like pretty basic functionality.

@coltonidle Conditions are possible via run_if, see my comment above at: Add if-else paths to the workflow

This #feature-request is about having another was to do an if-else, which is not decided yet. Mainly because run_if is more than sufficient in most cases, and a if-else syntax would just complicate things / the yml structure.

We should actually close this #feature-request I think, as run_if is well supported for a long time now and there’s no suggested syntax here which would be simpler than run_if.

Marked to auto close this #feature-request in two weeks

@viktorbenei Sorry… run_if? Just confirming this isn’t available in the workflow editor.

@coltonidle it’s available in the Workflow Editor but not on the UI -> in the YML mode (bitrise.yml tag). Mainly because it’s an advanced option which requires some getting used to / learning.

Feel free to create a #feature-request for a UI option for it! :wink:

@viktorbenei I’m alright with editing the yml directly. Just making sure it wasn’t some UI somewhere. I prefer editing code over a UI, but the workflow editor is pretty good.

1 Like

Got it - feel free to vote on the related Feature Requests to make run_if available on the UI! :wink:

This topic was automatically closed after 14 days. New replies are no longer allowed.