How To: Skip steps in your pipeline using Triggers
Overview
You have certain steps you want to skip over in certain circumstances. You are using a single pipeline for multiple triggers, but need certain tasks split.
Details
- Set a pipeline variable with a default value. For example,
SkipTest
set tofalse
- Select the Trigger (or create a new one) that you will use.
- Under “Advanced Options” locate Variables.
- Set a Variable with an appropriate name and value. For example,
SkipTest
set totrue
- Add a condition to your step. In this case, we will only run this step if the variable
SkipTest
is true.
when:
condition:
all:
skipdeploy: '${{SkipTest}} == "true"'
Notes Other options for skipping steps are available.