SONAR-16068 made SONAR_TOKEN optional

SONAR-16067 fixed file permissions
This commit is contained in:
Tobias Trabelsi
2022-03-01 10:34:32 +01:00
committed by GitHub
parent 72def085d4
commit bdba66714e
3 changed files with 16 additions and 5 deletions

View File

@@ -3,8 +3,9 @@
set -e
if [[ -z "${SONAR_TOKEN}" ]]; then
echo "This GitHub Action requires the SONAR_TOKEN env variable."
exit 1
echo "============================ WARNING ============================"
echo "Running this GitHub Action without SONAR_TOKEN is not recommended"
echo "============================ WARNING ============================"
fi
if [[ -z "${SONAR_HOST_URL}" ]]; then
@@ -25,3 +26,8 @@ fi
unset JAVA_HOME
sonar-scanner -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} ${INPUT_ARGS}
_tmp_file=$(ls "${INPUT_PROJECTBASEDIR}/" | head -1)
PERM=$(stat -c "%u:%g" "${INPUT_PROJECTBASEDIR}/$_tmp_file")
chown -R $PERM "${INPUT_PROJECTBASEDIR}/"