Add setting of projectName

This commit is contained in:
Dariusz Dwornikowski 2020-07-11 13:06:03 +02:00
parent 50fbee7c7b
commit accc346655
3 changed files with 8 additions and 0 deletions

View File

@ -37,6 +37,7 @@ uses: kitabisa/sonarqube-action@master
with:
projectBaseDir: my-custom-directory
projectKey: my-custom-project
projectName: "my-project-name"
```
## Secrets

View File

@ -15,6 +15,10 @@ inputs:
description: "The project's unique key. Allowed characters are: letters, numbers, -, _, . and :, with at least one non-digit."
required: false
default: ""
projectName:
description: "The project's name. If not given name will be generated by SonarQube"
required: false
default: ""
projectBaseDir:
description: "Set the sonar.projectBaseDir analysis property"
required: false

View File

@ -12,10 +12,13 @@ fi
[[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD=""
[[ -z ${INPUT_PROJECTKEY} ]] && SONAR_PROJECTKEY="${PWD##*/}" || SONAR_PROJECTKEY="${INPUT_PROJECTKEY}"
[[ -z ${INPUT_PROJECTNAME} ]] && SONAR_PROJECTNAME="${PWD##*/}" || SONAR_PROJECTKEY="${INPUT_PROJECTNAME}"
sonar-scanner \
-Dsonar.host.url=${INPUT_HOST} \
-Dsonar.projectKey=${SONAR_PROJECTKEY} \
-Dsonar.projectName=${SONAR_PROJECTNAME} \
-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \
-Dsonar.login=${INPUT_LOGIN} \
-Dsonar.password=${INPUT_PASSWORD} \