2020-10-30 11:46:53 +03:00
#!/bin/bash
echo "========================="
echo "= List of changed files ="
echo "========================="
git diff --name-only origin/$DRONE_TARGET_BRANCH ...$DRONE_COMMIT_SHA
echo "========================="
[ [ $( git diff --name-only origin/$DRONE_TARGET_BRANCH ...$DRONE_COMMIT_SHA | wc -l) -eq 0 ] ] && echo "No files are modified => merge commit" && exit 0
2020-10-30 11:47:27 +03:00
[ [ $( git diff --name-only origin/$DRONE_TARGET_BRANCH ...$DRONE_COMMIT_SHA | grep -c ".yml" ) -gt 0 ] ] && echo "YML files are modified" && exit 0
2020-10-30 11:46:53 +03:00
[ [ $( git diff --name-only origin/$DRONE_TARGET_BRANCH ...$DRONE_COMMIT_SHA | grep -c ".xml" ) -gt 0 ] ] && echo "info.xml files are modified" && exit 0
[ [ $( git diff --name-only origin/$DRONE_TARGET_BRANCH ...$DRONE_COMMIT_SHA | grep -c " .php $" ) -gt 0 ] ] && echo "PHP files are modified" && exit 0
[ [ $( git diff --name-only origin/$DRONE_TARGET_BRANCH ...$DRONE_COMMIT_SHA | grep -c "^tests/" ) -gt 0 ] ] && echo "PHP test files are modified" && exit 0
[ [ $( git diff --name-only origin/$DRONE_TARGET_BRANCH ...$DRONE_COMMIT_SHA | grep -c "/tests/" ) -gt 0 ] ] && echo "PHP test files of an app are modified" && exit 0
exit 1