{CI} Refine error guidance for azdev scan (medium confidence) task (#8402)

* add azdev scan - Pro task

* test

* error msg style

* continue on failure

* echo -> printf

* revert test change

* rename task

* fix

* refine error guidance
This commit is contained in:
Yishi Wang 2025-01-09 15:44:59 +08:00 коммит произвёл GitHub
Родитель 8f8d9ffce1
Коммит 77116f43c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -184,7 +184,7 @@ jobs:
for FILE in `git diff --name-only --diff-filter=AM origin/$(System.PullRequest.TargetBranch)` ; do
detected=$(azdev scan -f $FILE --continue-on-failure| python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
if [ $detected == 'True' ]; then
printf "\033[0;31mSecrets detected from %s, Please remove or replace it. You can run 'azdev scan'/'azdev mask' locally to fix.\033[0m" "$FILE"
printf "\033[0;31mSecrets detected from %s, Please remove or replace it. You can run 'azdev scan'/'azdev mask' locally to fix.\033[0m\n" "$FILE"
secret_files+=$FILE
fi
done
@ -215,7 +215,7 @@ jobs:
for FILE in `git diff --name-only --diff-filter=AM origin/$(System.PullRequest.TargetBranch)` ; do
detected=$(azdev scan --confidence-level MEDIUM -f $FILE --continue-on-failure| python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
if [ $detected == 'True' ]; then
printf "\033[0;31mSecrets detected from %s, Please remove or replace it. You can run 'azdev scan'/'azdev mask' locally to fix.\033[0m" "$FILE"
printf "\033[0;31mSecrets detected from %s, Please remove or replace it. You can run 'azdev scan --confidence-level MEDIUM'/'azdev mask --confidence-level MEDIUM' locally to fix.\033[0m\n" "$FILE"
secret_files+=$FILE
fi
done