TRAVIS_COMMIT_RANGE only lists the range of commits for the most recent push. This means that if a user incrementally updates a PR by pushing to the branch it's based on, the above won't give you the full list of files for the PR, just the most recent push. The third is actually the easiest to solve, so we'll cover that first.
As of July 2020 that is not true. I just tested this and for a Pull Request ${TRAVIS_COMMIT_RANGE/.../..} is strictly identical to ${TRAVIS_BRANCH}..HEAD no matter what you (force) push to your submitted branch and how. So it may be possible to simplify that particular if PR/then/else.
Also, you want to keep the triple dots ... in TRAVIS_COMMIT_RANGE for git diff, they're very important and very different from double dots. Replace them with double dots ..only for the git log command which is inconsistent with git diff, see explanation at github.com/travis-ci/travis-ci/iss...
PS: Travis documentation seems to fall very short here.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
As of July 2020 that is not true. I just tested this and for a Pull Request
${TRAVIS_COMMIT_RANGE/.../..}
is strictly identical to${TRAVIS_BRANCH}..HEAD
no matter what you (force) push to your submitted branch and how. So it may be possible to simplify that particularif PR/then/else
.Also, you want to keep the triple dots
...
inTRAVIS_COMMIT_RANGE
forgit diff
, they're very important and very different from double dots. Replace them with double dots..
only for thegit log
command which is inconsistent withgit diff
, see explanation at github.com/travis-ci/travis-ci/iss...PS: Travis documentation seems to fall very short here.