Improve pre-commit message (#8360)
This commit is contained in:
Родитель
f1ca9b94c2
Коммит
b3f7d8dafa
|
@ -28,7 +28,10 @@ foreach ($file in $files) {
|
|||
# Check if the file contains secrets
|
||||
$detected = $(azdev scan -f $file | ConvertFrom-Json).secrets_detected
|
||||
if ($detected -eq "True") {
|
||||
Write-Host "Detected secrets from $file. You can run 'azdev mask' to remove secrets before commit." -ForegroundColor Red
|
||||
Write-Host "Detected secrets from $file. Please run the following command to mask it:" -ForegroundColor Red
|
||||
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++" -ForegroundColor Red
|
||||
Write-Host "azdev mask -f $file" -ForegroundColor Red
|
||||
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++" -ForegroundColor Red
|
||||
$hasSecrets = 1
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,10 @@ for FILE in `git diff --cached --name-only --diff-filter=AM $against` ; do
|
|||
# Check if the file contains secrets
|
||||
detected=$(azdev scan -f "$FILE" | python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
|
||||
if [ "$detected" = "True" ]; then
|
||||
printf "\033[0;31mDetected secrets from %s, You can run 'azdev mask' to remove secrets before commit.\033[0m\n" "$FILE"
|
||||
printf "\033[0;31mDetected secrets from %s, Please run the following command to mask it:\033[0m\n" "$FILE"
|
||||
printf "\033[0;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++\033[0m\n"
|
||||
printf "\033[0;31mazdev mask -f %s\033[0m\n" "$FILE"
|
||||
printf "\033[0;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++\033[0m\n"
|
||||
has_secrets=1
|
||||
fi
|
||||
done
|
||||
|
|
Загрузка…
Ссылка в новой задаче