Skip to content

Instantly share code, notes, and snippets.

@abiosoft
Created May 27, 2018 15:36
Show Gist options
  • Save abiosoft/d4ba7d7f5f7dc09ebbb16b7574ee5f8c to your computer and use it in GitHub Desktop.
Save abiosoft/d4ba7d7f5f7dc09ebbb16b7574ee5f8c to your computer and use it in GitHub Desktop.
REMOTE=${REMOTE:-"upstream/master"}
DOC_EXAMPLE_CHANGE_PATTERN="\
-e ^doc/ \
-e ^examples/ \
-e ^(VERSION|LICENSE)$ \
-e \.md$\
"
echo using remote $REMOTE
LINES=$(git --no-pager diff --name-only HEAD..$REMOTE | grep -vE $DOC_EXAMPLE_CHANGE_PATTERN | wc -l)
if [ $LINES -gt 0 ]; then
echo "$LINES files changed"
else
echo "CI not needed"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment