-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sn' of github.com:frodopwns/azure-service-operator into sn
- Loading branch information
Showing
2 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
IGNORE_FILTERS=("docs/" "README.md") | ||
CHANGED_FILES=$(git diff HEAD HEAD~ --name-only) | ||
IGNORED_COUNT=0 | ||
NON_IGNORED_COUNT=0 | ||
echo "Checking for file changes..." | ||
for FILE in $CHANGED_FILES; do | ||
# Check if the file matches one of the ignore filters | ||
MATCHED=0 | ||
for FILTER in ${IGNORE_FILTERS[@]}; do | ||
if [[ $FILE == *$FILTER* ]]; then | ||
MATCHED=1 | ||
echo "${FILE} in ignore filter $FILTER" | ||
fi | ||
done | ||
|
||
if [[ $MATCHED -eq 0 ]]; then | ||
echo "Source code file ${FILE} changed" | ||
NON_IGNORED_COUNT=$(($NON_IGNORED_COUNT+1)) | ||
else | ||
IGNORED_COUNT=$(($IGNORED_COUNT+1)) | ||
|
||
fi | ||
done | ||
|
||
echo "" # Blank line for readability | ||
echo "$IGNORED_COUNT match(es) for ignore filter '${IGNORE_FILTERS[*]}' found." | ||
echo "$NON_IGNORED_COUNT match(es) for changed source code files found." | ||
if [[ $NON_IGNORED_COUNT -gt 0 ]]; then | ||
echo "##vso[task.setvariable variable=SOURCE_CODE_CHANGED;isOutput=true]true" | ||
else | ||
echo "##vso[task.setvariable variable=SOURCE_CODE_CHANGED;isOutput=true]false" | ||
fi |