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: $TRAVIS_COMMIT_RANGE
.
Then it was only a matter of changing the script to:
CHANGED_FILES=($(git diff --name-only $TRAVIS_COMMIT_RANGE))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With