Skip Travis stage if PR does not contain changes to certain path

21 Views Asked by At

I am trying to write if condition to a Travis stage so it will be executed only if the PR contains files from a certain path. The following does not work for me and I guess the syntax is wrong.

  jobs:
    include:
     - stage: test
       name: "my test"
       if: [ `git diff --name-only ${TRAVIS_COMMIT_RANGE}` == *"dir"* ]
       script:
       - echo "execute"
0

There are 0 best solutions below