mirror of
https://github.com/kitabisa/sonarqube-action.git
synced 2025-11-03 06:54:18 +08:00
Merge pull request #20 from jankal/master
Update docker base image & respect sonar-project.properties
This commit is contained in:
commit
9b52913486
@ -1,11 +1,11 @@
|
|||||||
FROM newtmitch/sonar-scanner:4.0.0-alpine
|
FROM newtmitch/sonar-scanner:4.5
|
||||||
|
|
||||||
LABEL "com.github.actions.name"="SonarQube Scan"
|
LABEL "com.github.actions.name"="SonarQube Scan"
|
||||||
LABEL "com.github.actions.description"="Scan your code with SonarQube Scanner to detect bugs, vulnerabilities and code smells in more than 25 programming languages."
|
LABEL "com.github.actions.description"="Scan your code with SonarQube Scanner to detect bugs, vulnerabilities and code smells in more than 25 programming languages."
|
||||||
LABEL "com.github.actions.icon"="check"
|
LABEL "com.github.actions.icon"="check"
|
||||||
LABEL "com.github.actions.color"="green"
|
LABEL "com.github.actions.color"="green"
|
||||||
|
|
||||||
LABEL version="0.0.1"
|
LABEL version="0.0.2"
|
||||||
LABEL repository="https://github.com/kitabisa/sonarqube-action"
|
LABEL repository="https://github.com/kitabisa/sonarqube-action"
|
||||||
LABEL homepage="https://kitabisa.github.io"
|
LABEL homepage="https://kitabisa.github.io"
|
||||||
LABEL maintainer="dwisiswant0"
|
LABEL maintainer="dwisiswant0"
|
||||||
|
|||||||
@ -13,10 +13,11 @@ fi
|
|||||||
REPOSITORY_NAME=$(basename "${GITHUB_REPOSITORY}")
|
REPOSITORY_NAME=$(basename "${GITHUB_REPOSITORY}")
|
||||||
|
|
||||||
[[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD=""
|
[[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD=""
|
||||||
|
|
||||||
|
if [[ ! -f "${GITHUB_WORKSPACE}/sonar-project.properties" ]]; then
|
||||||
[[ -z ${INPUT_PROJECTKEY} ]] && SONAR_PROJECTKEY="${REPOSITORY_NAME}" || SONAR_PROJECTKEY="${INPUT_PROJECTKEY}"
|
[[ -z ${INPUT_PROJECTKEY} ]] && SONAR_PROJECTKEY="${REPOSITORY_NAME}" || SONAR_PROJECTKEY="${INPUT_PROJECTKEY}"
|
||||||
[[ -z ${INPUT_PROJECTNAME} ]] && SONAR_PROJECTNAME="${REPOSITORY_NAME}" || SONAR_PROJECTNAME="${INPUT_PROJECTNAME}"
|
[[ -z ${INPUT_PROJECTNAME} ]] && SONAR_PROJECTNAME="${REPOSITORY_NAME}" || SONAR_PROJECTNAME="${INPUT_PROJECTNAME}"
|
||||||
[[ -z ${INPUT_PROJECTVERSION} ]] && SONAR_PROJECTVERSION="" || SONAR_PROJECTVERSION="${INPUT_PROJECTVERSION}"
|
[[ -z ${INPUT_PROJECTVERSION} ]] && SONAR_PROJECTVERSION="" || SONAR_PROJECTVERSION="${INPUT_PROJECTVERSION}"
|
||||||
|
|
||||||
sonar-scanner \
|
sonar-scanner \
|
||||||
-Dsonar.host.url=${INPUT_HOST} \
|
-Dsonar.host.url=${INPUT_HOST} \
|
||||||
-Dsonar.projectKey=${SONAR_PROJECTKEY} \
|
-Dsonar.projectKey=${SONAR_PROJECTKEY} \
|
||||||
@ -24,6 +25,13 @@ sonar-scanner \
|
|||||||
-Dsonar.projectVersion=${SONAR_PROJECTVERSION} \
|
-Dsonar.projectVersion=${SONAR_PROJECTVERSION} \
|
||||||
-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \
|
-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \
|
||||||
-Dsonar.login=${INPUT_LOGIN} \
|
-Dsonar.login=${INPUT_LOGIN} \
|
||||||
-Dsonar.password=${INPUT_PASSWORD} \
|
-Dsonar.password=${SONAR_PASSWORD} \
|
||||||
-Dsonar.sources=. \
|
-Dsonar.sources=. \
|
||||||
-Dsonar.sourceEncoding=UTF-8
|
-Dsonar.sourceEncoding=UTF-8
|
||||||
|
else
|
||||||
|
sonar-scanner \
|
||||||
|
-Dsonar.host.url=${INPUT_HOST} \
|
||||||
|
-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \
|
||||||
|
-Dsonar.login=${INPUT_LOGIN} \
|
||||||
|
-Dsonar.password=${SONAR_PASSWORD}
|
||||||
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user