mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 16:20:28 +00:00
5db647ba64
Changes in scripts will affect the CI jobs as the scripts are used while deploying minikube, Rook and other components. These changes need testing, just like anything else. Signed-off-by: Niels de Vos <ndevos@redhat.com>
36 lines
665 B
Bash
Executable File
36 lines
665 B
Bash
Executable File
#!/bin/bash -e
|
|
#
|
|
|
|
GIT_SINCE="${1}"
|
|
if [ -z "${GIT_SINCE}" ]; then
|
|
GIT_SINCE='origin/master'
|
|
fi
|
|
|
|
CHANGED_FILES=$(git diff --name-only "${GIT_SINCE}")
|
|
|
|
[[ -z $CHANGED_FILES ]] && exit 1
|
|
|
|
skip=0
|
|
#files to be skipped
|
|
declare -a FILES=(^docs/ .md$ LICENSE .mergify.yml .github .gitignore .commitlintrc.yml)
|
|
|
|
function check_file_present() {
|
|
local file=$1
|
|
for FILE in "${FILES[@]}"; do
|
|
if [[ $file =~ $FILE ]]; then
|
|
return 0
|
|
fi
|
|
done
|
|
return 1
|
|
}
|
|
|
|
for CHANGED_FILE in $CHANGED_FILES; do
|
|
if ! check_file_present "$CHANGED_FILE"; then
|
|
skip=1
|
|
fi
|
|
done
|
|
if [ $skip -eq 0 ]; then
|
|
echo "doc change only"
|
|
exit 1
|
|
fi
|