SQSCANGHA-92 Validate scanner version (#189)

Co-authored-by: Julien HENRY <julien.henry@sonarsource.com>
This commit is contained in:
csaba-feher-sonarsource
2025-05-05 17:48:40 +02:00
committed by GitHub
parent 73bc64cb64
commit 2500896589
3 changed files with 29 additions and 0 deletions

View File

@@ -2,6 +2,11 @@
set -eo pipefail
if [[ ! "${INPUT_SCANNERVERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error title=SonarScanner::Invalid scannerVersion format. Expected format: x.y.z.w (e.g., 7.1.0.4889)"
exit 1
fi
if [[ -z "${SONAR_TOKEN}" ]]; then
echo "::warning title=SonarScanner::Running this GitHub Action without SONAR_TOKEN is not recommended"
fi