in github action I have an if, but I still need to run someother thing if I'm in the else case. Is there a clean way to do it or do I have to do another step with the same condition at false?
- if: contains(['SNAPSHOT'],env.BUILD_VERSION)
name:IF
run: echo ":)"
- if: false == contains(['SNAPSHOT'], env.BUILD_VERSION)
name: Else
run: echo ":("
GitHub Actions doesn't have else statement to run a different command/action/code. But you're right, all what you need to do is to create another step with reversed if condition. BTW, you can just use !
instead of false ==
.
Here are some links: if statement, operators