Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: ElseIf #92

Open
ay-azara opened this issue May 4, 2023 · 0 comments
Open

Feature Request: ElseIf #92

ay-azara opened this issue May 4, 2023 · 0 comments

Comments

@ay-azara
Copy link

ay-azara commented May 4, 2023

Hey Octo Crew, would adding an elseif be possible?

Below is an example from Variable Substitutions.

#{if Octopus.Environment.Name == "Development"}
  Do this if it's Development
#{else}
  #{if Octopus.Environment.Name == "Test"}
    Do this if it's Test
  #{else}
    Do this if it's neither
  #{/if}
#{/if}

If I understand it right, every extra if has to be nested and would quickly get out of control. It would be nice to express complex checks as.

#{if Octopus.Environment.Name == "Development"}
  Do this if it's Development
#{elseif Octopus.Environment.Name == "Test"}
  Do this if it's Test
#{else}
  Do this if it's neither
#{/if}

Probably not wise to add too many conditions but what's missing from the examples when it comes to run conditions is one level of #{if Octopus.Deployment.Error == "True"}False{/if} because you can't use "Variable Conditions" without disabling "Success: only run when previous steps succeed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant