Overview#
This issue proposes adding an if condition to a step such that the step only runs when the condition is true.
Why#
Consider the scenario where I want to publish a blog to some hosting provider like Netlify or Vercel using a Git based workflow. When I add a new post through a PR, I would like to have the article published to a preview url for me to get a sense of its look and feel and then only publish the article to my main site on merging to main. At the moment, this is possible on spindle by having two workflows one for publishing the preview and another for publishing to the main site.
This scenario can be simplified by introducing conditional step execution; such that the publishing to main site step only runs when the PR is merged to main. For other similar scenarios having conditional step execution can reduce pressure on compute infrastructure since a single workflow will be sufficient instead of having multiple workflows run in parallel.
Implementation Plan#
- Add support for
ifin the step schema - Check if the specified condition is true during step execution
- Add support for a skipped status kind