I have a Travis script that runs for every push.
I need to determine which files were modified in this push.
Currently, I have this:
CHANGED_FILES=($(git diff --name-only HEAD HEAD~1))
The problem is that sometimes a push can include more than one commits, and this only looks at the last commit.
What is the expected way to solve this?
I found out there is a Travis environment variable:
Then it was only a matter of changing the script to:
CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))