File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 2020 against=$( git hash-object -t tree /dev/null)
2121fi
2222has_secrets=0
23+
24+ IFS_OLD=${IFS}
25+ IFS=$' \n '
2326for FILE in ` git diff --cached --name-only --diff-filter=AM $against ` ; do
2427 # Check if the file contains secrets
2528 detected=$( azdev scan -f " $FILE " | python -c " import sys, json; print(json.load(sys.stdin)['secrets_detected'])" )
@@ -28,6 +31,7 @@ for FILE in `git diff --cached --name-only --diff-filter=AM $against` ; do
2831 has_secrets=1
2932 fi
3033done
34+ IFS=${IFS_OLD}
3135
3236if [ $has_secrets -eq 1 ]; then
3337 printf " \033[0;31mSecret detected. If you want to skip that, run add '--no-verify' in the end of 'git commit' command.\033[0m\n"
Original file line number Diff line number Diff line change @@ -1137,13 +1137,17 @@ jobs:
11371137 . env/bin/activate
11381138 git fetch origin --depth=1 $(System.PullRequest.TargetBranch)
11391139 declare -A secret_files
1140+ IFS_OLD=${IFS}
1141+ IFS=$'\n'
11401142 for FILE in `git diff --name-only --diff-filter=AM origin/$(System.PullRequest.TargetBranch)` ; do
1143+ echo $FILE
11411144 detected=$(azdev scan -f "$FILE" | python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
11421145 if [ $detected == 'True' ]; then
11431146 printf "\033[0;31mDetected secrets from %s, You can run 'azdev mask' to remove secrets.\033[0m\n" "$FILE"
11441147 secret_files+=$FILE
11451148 fi
11461149 done
1150+ IFS=${IFS_OLD}
11471151 if [ "${#secret_files[@]}" -gt 0 ]; then
11481152 exit 1
11491153 fi
You can’t perform that action at this time.
0 commit comments