Conditional expression documentation?

I’ve seen posts like the one before showing YAML conditional expressions and it appears to be what I need, but I can’t find any documentation, either circleci specific or yaml, that describes the syntax of if expressions. I want to be able to do different things based on the current branch name in the config file rather than in a script file (what I am currently doing). Posts like the one below make it seem like this should be possible in the Circleci config file, but I can’t find any documentation on the syntax. Can someone point me to some?

Posts like this are what lead me to believe conditional commands are possible, or conditional steps (I looked at when/unless, but they can’t use environment variables):

Any pointers to documentation on the syntax for such expressions would be greatly appreciated.

There are a couple of approaches:

  1. There is some built in conditional logic in the new 2.1 syntax: https://circleci.com/docs/2.0/reusing-config/#defining-conditional-steps
  2. Things like [[ ]] are bash conditional expressions. You can learn more about that in the bash manual page.

Ah, I guess I did not realize that, as I am not a bash user. Thanks for the info!

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