Using IsSkipped in a Run Condition

I’m having a bit of trouble setting RunConditions based on a previous step IsSkipped status.

I have steps like:

  1. Create a Database Only If Not Exists
  2. Populate the database

If step 1 is skipped (database already existed) I do not want step 2 to run.

My attempted run condition on step 2 is:

#{if Octopus.Action[Create a Database Only If Not Exists].IsSkipped == “True”}
false
#{else}
true
#{/if}

Step 1 skips if the database exists.
Step 2 is always running, regardless if step one is skipped or not.

What am I missing?

For now I’ve worked around by modifying Step 1 to set an output variable named
“RunCondition-RunSQLScripts” and setting my run conditions like:

#{Octopus.Action[Create a Database Only If Not Exists].Output.RunCondition-RunSQLScripts}

That works.

Just not sure what I’m not understanding about using the IsSkipped status?

Hi,

Thanks for getting in touch! You’re right on the money, and setting an output variable like this is what we would have suggested. The IsSkipped variable only evaluates to True when a step isn’t included in the deployment, and it looks like Octopus considers this step run and successful.

Great to hear you’ve worked around it! Don’t hesitate to reach out if you have any questions or concerns moving forward. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.