e.g.:
if (Math.random() < 0.5) {
pipeline.add(conditionalA)
}
if (pipeline.hasSteps()) {
pipeline.add(conditionalB)
}
Right now this is not possible with buildkite-graph alone, as conditional steps are still steps. The only way that is possible is to keep the state of the pipeline separate, e.g.:
let hasSteps = false;
if (Math.random() < 0.5) {
pipeline.add(conditionalA)
hasSteps = true;
}
if (hasSteps) {
pipeline.add(conditionalB)
}
e.g.:
Right now this is not possible with
buildkite-graphalone, as conditional steps are still steps. The only way that is possible is to keep the state of the pipeline separate, e.g.: