diff --git a/README.md b/README.md index e897d4a..da8f170 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ uses: kitabisa/sonarqube-action@master with: projectBaseDir: my-custom-directory projectKey: my-custom-project + projectName: "my-project-name" + projectVersion: "my-project-version" ``` ## Secrets diff --git a/action.yaml b/action.yaml index 411651c..d221890 100644 --- a/action.yaml +++ b/action.yaml @@ -15,6 +15,14 @@ inputs: description: "The project's unique key. Allowed characters are: letters, numbers, -, _, . and :, with at least one non-digit." required: false default: "" + projectName: + description: "Name of the project that will be displayed on the web interface." + required: false + default: "" + projectVersion: + description: "The project version." + required: false + default: "" projectBaseDir: description: "Set the sonar.projectBaseDir analysis property" required: false diff --git a/entrypoint.sh b/entrypoint.sh index 5977021..49af028 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,10 +12,15 @@ 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_PROJECTNAME="${INPUT_PROJECTNAME}" +[[ -z ${INPUT_PROJECTVERSION} ]] && SONAR_PROJECTVERSION="" || SONAR_PROJECTVERSION="${INPUT_PROJECTVERSION}" + sonar-scanner \ -Dsonar.host.url=${INPUT_HOST} \ -Dsonar.projectKey=${SONAR_PROJECTKEY} \ + -Dsonar.projectName=${SONAR_PROJECTNAME} \ + -Dsonar.projectVersion=${SONAR_PROJECTVERSION} \ -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \ -Dsonar.login=${INPUT_LOGIN} \ -Dsonar.password=${INPUT_PASSWORD} \