Enable/Disable a step (optionally, based on a condition)

If you don't want to remove the Step from your Workflow and you don't want to
duplicate the Workflow either (which is the preferred way if you want to experiment with new things;
you can just create a "backup" clone of your original Workflow)
then you can simply disable a Step by specifying run_if: false .

This is quite similar to how you completely disable a step,
but instead of specifying false
as the run_if expression, you specify .IsCI, which will only be true in CI mode.

This method can be useful to debug builds locally, where you don't want to run
specific steps on your own Mac/PC. Lots of Steps have this run_if flag set by default,
for example the Git Clone step is configured with run_if: .IsCI in the step's
default configuration (step.yml), because the most common use case when you
run a build locally is that you already have the code on your Mac/PC
and so you don't want to do a Git Clone. Of course you can change the run_if
property of any step, so you can specify a run_if: true for the Git Clone
step if you want to run it locally too.

Note

CI mode can be enabled on your own Mac/PC by setting the CI environment to true
(e.g. with export CI=true in your Bash Terminal), or by running
bitrise run with the --ci flag: bitrise --ci run ...._

A run_if can be any valid Go template, as long as it evaluates to true or false (or any of the String representation, e.g. "True", "t", "yes" or "y" are all considered to be true). If the template evaluates to true the Step will run, otherwise it won't.

An example run_if to check a custom environment variable (you
can expose environment variables from your scripts too,
using envman):