solana/ci/affects.sh

26 lines
444 B
Bash
Raw Normal View History

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