2020-06-11 21:56:20 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2020-06-14 22:18:00 -07:00
|
|
|
# Check if files in the commit range match one or more prefixes
|
2020-06-11 21:56:20 -07:00
|
|
|
#
|
|
|
|
|
2020-07-15 20:22:51 -07:00
|
|
|
# Always run the job if we are on a tagged release
|
|
|
|
if [[ -n "$TRAVIS_TAG" ]]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-06-11 21:56:20 -07:00
|
|
|
(
|
|
|
|
set -x
|
2020-06-12 16:06:32 -07:00
|
|
|
git diff --name-only "$TRAVIS_COMMIT_RANGE"
|
2020-06-11 21:56:20 -07:00
|
|
|
)
|
|
|
|
|
2020-06-12 16:06:32 -07:00
|
|
|
for file in $(git diff --name-only "$TRAVIS_COMMIT_RANGE"); do
|
2020-06-14 22:18:00 -07:00
|
|
|
for prefix in "$@"; do
|
|
|
|
if [[ $file =~ ^"$prefix" ]]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
done
|
2020-06-11 21:56:20 -07:00
|
|
|
done
|
|
|
|
|
2020-06-14 23:16:55 -07:00
|
|
|
echo "No modifications to $*"
|
2020-06-11 21:56:20 -07:00
|
|
|
exit 1
|