Skipping a step from a plugin hook?

One can add conditionals to a command step to skip it under certain circumstances. However, this exposes these circumstances in the pipeline YAML.

For a plugin, I would like to “bake in” these conditions to one of the hooks (pre-command I guess) in such a way that the step is marked as skipped. Is that possible?

I could just exit when the conditions are met, but then the step will be considered successful, rather than skipped. Maybe it’s possible with buildkite-agent step update, but the documentation’s not clear on this…

Hi @Xophmeister,

Welcome to the Buildkite Support Community!

The command buildkite-agent step update does not support updating the skip attribute of the command currently. The other option would be is to dynamically create that step and add in the skip attribute if the conditions are met.

Hope this helps.

Cheers.

1 Like

Thank you, @lizette