From bdec21efd9abbd6bb0216e24efeb817a194247a7 Mon Sep 17 00:00:00 2001 From: vil02 Date: Sun, 7 Jul 2024 21:59:03 +0200 Subject: [PATCH 1/2] Prevent globbing and word splitting --- cleanup.sh | 2 +- entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cleanup.sh b/cleanup.sh index 72d5f41..8a5e4c9 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -10,5 +10,5 @@ fi _tmp_file=$(ls "${INPUT_PROJECTBASEDIR}/" | head -1) PERM=$(stat -c "%u:%g" "${INPUT_PROJECTBASEDIR}/$_tmp_file") -chown -R $PERM "${INPUT_PROJECTBASEDIR}/.scannerwork/" +chown -R "$PERM" "${INPUT_PROJECTBASEDIR}/.scannerwork/" diff --git a/entrypoint.sh b/entrypoint.sh index 9cd1c40..cbba81a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,4 +27,4 @@ if [[ "$RUNNER_DEBUG" == '1' ]]; then fi unset JAVA_HOME -sonar-scanner $debug_flag -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} -Dsonar.host.url=${SONARCLOUD_URL} ${INPUT_ARGS} +sonar-scanner "$debug_flag" -Dsonar.projectBaseDir="${INPUT_PROJECTBASEDIR}" -Dsonar.host.url="${SONARCLOUD_URL}" "${INPUT_ARGS}" From 86f2bbdd77862fc8482ad3d8aaeac9152719a874 Mon Sep 17 00:00:00 2001 From: "antoine.vinot" Date: Fri, 12 Jul 2024 08:49:45 +0200 Subject: [PATCH 2/2] Testing QA --- entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index cbba81a..debeead 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,10 +21,10 @@ if [[ -z "${SONARCLOUD_URL}" ]]; then SONARCLOUD_URL="https://sonarcloud.io" fi -debug_flag='' -if [[ "$RUNNER_DEBUG" == '1' ]]; then - debug_flag=' --debug ' -fi + +debug="" +[[ "$RUNNER_DEBUG" == '1' ]] && debug="yes" unset JAVA_HOME -sonar-scanner "$debug_flag" -Dsonar.projectBaseDir="${INPUT_PROJECTBASEDIR}" -Dsonar.host.url="${SONARCLOUD_URL}" "${INPUT_ARGS}" + +sonar-scanner ${debug:+"--debug"} -Dsonar.projectBaseDir="${INPUT_PROJECTBASEDIR}" -Dsonar.host.url="${SONARCLOUD_URL}" "${INPUT_ARGS}"