Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created August 2, 2018 12:30
Show Gist options
  • Save eminetto/d56a23cbaed473db47cf73af32f7f9a1 to your computer and use it in GitHub Desktop.
Save eminetto/d56a23cbaed473db47cf73af32f7f9a1 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
export IGNORE_FILES=$(ls -p | grep -v /)
detect_changed_folders() {
if [[ "${DRONE_PULL_REQUEST}" ]]; then
folders=$(git --no-pager diff --name-only FETCH_HEAD FETCH_HEAD~1 | sort -u | awk 'BEGIN {FS="/"} {print $1}' | uniq);
else
folders=$(git --no-pager diff --name-only HEAD~1 | sort -u | awk 'BEGIN {FS="/"} {print $1}' | uniq);
fi
export changed_components=$folders
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment