Created
April 8, 2019 10:01
-
-
Save bioform/268bc22039a9e3cf23486c09a603818f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TEAM=$1 | |
BRANCH=$2 | |
OWNED_PATTERNS=$(cat ./.github/CODEOWNERS|grep @toptal/$TEAM |cut -d' ' -f1| sed -e 's/^/\.\//') | |
OWNED_FILES=`git ls-files $OWNED_PATTERNS` | |
git fetch origin $BRANCH:$BRANCH | |
CHANGED_FILES=`git diff --name-only $BRANCH $(git merge-base $BRANCH origin/master)` | |
echo "--------------------------------------------" | |
for FILE in $CHANGED_FILES; do | |
if [[ -n `echo "$OWNED_FILES" | grep $FILE` ]] | |
then | |
echo $FILE | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment