Add if-else paths to the workflow

#1

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

0 Likes

#2

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

0 Likes

#3

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.

0 Likes

#4

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

0 Likes

#5

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.

0 Likes

#6

@viktorbenei

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

0 Likes

#7

@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

0 Likes

#8

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

0 Likes

#9

@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:

0 Likes

#10

@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

#11

Got it - feel free to vote on the related #feature-request to make run_if available on the UI! :wink:

0 Likes

closed #12

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

0 Likes