Travis throws error `line 728: expected `)'`


I am using following piece of code in Travis file.

  skip_cleanup: true
  provider: script
  script: bash hello_arg
    all_branches: true
    condition: ($TRAVIS_BRANCH =~ /.*(?i:hotfix).*|\bdev\b/) AND ($TRAVIS_EVENT_TYPE != cron)

I get the following error each time build starts:

Worker information

startup: 6.406738177s

/home/travis/.travis/job_stages: line 728: expected `)'

/home/travis/.travis/job_stages: line 728: syntax error near `AND'

/home/travis/.travis/job_stages: line 728: ` if [[ (($TRAVIS_BRANCH =~ /.*(?i:hotfix).*|\bdev\b/) AND ($TRAVIS_EVENT_TYPE != cron)) ]]; then'

I find the reason is that two conditions cant be under Condition:.


is not a valid Bash condition. You probably mean &&, not AND.


Using && instead of AND may work but usage of AND is documented in Travis documentation here.


The deployment condition does not use that. The more relevant documentation is found at