File tree Expand file tree Collapse file tree 4 files changed +3
-31
lines changed
Expand file tree Collapse file tree 4 files changed +3
-31
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ $files = $(git diff --cached --name-only --diff-filter=AM $against)
2626
2727foreach ($file in $files ) {
2828 # Check if the file contains secrets
29- $detected = $ (azdev scan -f $file | ConvertFrom-Json ).secrets_detected
29+ $detected = $ (azdev scan -f $file -- continue - on - failure | ConvertFrom-Json ).secrets_detected
3030 if ($detected -eq " True" ) {
3131 Write-Host " Detected secrets from $file . Please run the following command to mask it:" - ForegroundColor Red
3232 Write-Host " +++++++++++++++++++++++++++++++++++++++++++++++++++++++" - ForegroundColor Red
Original file line number Diff line number Diff line change 2222has_secrets=0
2323for FILE in ` git diff --cached --name-only --diff-filter=AM $against ` ; do
2424 # Check if the file contains secrets
25- detected=$( azdev scan -f " $FILE " | python -c " import sys, json; print(json.load(sys.stdin)['secrets_detected'])" )
25+ detected=$( azdev scan -f " $FILE " --continue-on-failure | python -c " import sys, json; print(json.load(sys.stdin)['secrets_detected'])" )
2626 if [ " $detected " = " True" ]; then
2727 printf " \033[0;31mDetected secrets from %s, Please run the following command to mask it:\033[0m\n" " $FILE "
2828 printf " \033[0;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++\033[0m\n"
Original file line number Diff line number Diff line change @@ -1143,7 +1143,7 @@ jobs:
11431143 IFS=$'\n'
11441144 for FILE in `git diff --name-only --diff-filter=AM origin/$(System.PullRequest.TargetBranch)` ; do
11451145 echo $FILE
1146- detected=$(azdev scan -f "$FILE" | python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
1146+ detected=$(azdev scan -f "$FILE" --continue-on-failure | python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
11471147 if [ $detected == 'True' ]; then
11481148 printf "\033[0;31mDetected secrets from %s, You can run 'azdev mask' to remove secrets.\033[0m\n" "$FILE"
11491149 secret_files+=$FILE
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments