buildkite-graph
buildkite-graph copied to clipboard
Allow introspection into pipeline, so other steps can react
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)
}