buildkite-graph icon indicating copy to clipboard operation
buildkite-graph copied to clipboard

Allow introspection into pipeline, so other steps can react

Open joscha opened this issue 6 years ago • 0 comments

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)
}

joscha avatar Aug 16 '19 07:08 joscha