Help with Build Conditions - condition seem to always be true

I have a travis file (test file ) that builds different jobs depending on the build conditions set. However, all the job builds get performed, which can only suggest that the build (if) condition is resolving to true. Here is an example of one of the jobs;

- stage: waaoathxx
  name: "Build WAAOATHXX Docker Image"
  if: env(TRAVIS_COMMIT_MESSAGE) =~ /waaorchservices/
  script:
    - echo $BUILD_BRANCH 
    - echo $TRAVIS_COMMIT_MESSAGE
    - echo "waaoathxx"

- stage: waaoathxxx
  name: "Build WAAOATHXXX Docker Image"
  script:
    - echo $BUILD_BRANCH $TRAVIS_COMMIT_MESSAGE
    - echo "waaoathxxx"
  if: $TRAVIS_COMMIT_MESSAGE =~ /waaorchservices/

- stage: waaoathxxxx
  name: "Build WAAOATHXXXX Docker Image"
  if: env($TRAVIS_COMMIT_MESSAGE) =~ /waaorchservices/
  scrit:
    - echo $BUILD_BRANCH $TRAVIS_COMMIT_MESSAGE
    - echo "waaoathxxxx"

The commit message is "test script [waa_full_build] … so if my understanding is correct none of these jobs should be performed, and in fact ignored.

Whats going wrong?

1 Like

I am facing a very similar issue, also related to commit_message condition. This is mine: Need help to prevent duplicate builds for pull_request and push . I would also like to get an answer to that. I hope someone here can help.

Imprint