Running script conditionally does not work in travis.yml, why?
<p>The following causes travis to not build at all. When I try to validate the <code>travis.yml</code> file, it complains that the line just above the if statement is missing a <code>-</code> character at column 3, but the error has to do with the if statement below.</p>

<p>Do I have to move the if statement out to a script?</p>

<pre><code># Deploy
after_success:
  - ./tools/docker-push-container.sh
  - if [ $TRAVIS_BRANCH == "master" &amp;&amp; $TRAVIS_PULL_REQUEST == "false" ]; then
      ./.travis/success_message.sh
    fi
</code></pre>