mirror of
https://github.com/kitabisa/sonarqube-action.git
synced 2025-11-01 22:04:20 +08:00
🪲 Add dynamic projectKey input. Fixes #5
This commit is contained in:
parent
abc24397e0
commit
bb543d0f7a
30
action.yaml
30
action.yaml
@ -1,23 +1,27 @@
|
||||
name: 'SonarQube Scan'
|
||||
description: 'Scan your code with SonarQube Scanner to detect bugs, vulnerabilities and code smells in more than 25 programming languages.'
|
||||
author: 'Dwi Siswanto'
|
||||
name: "SonarQube Scan"
|
||||
description: "Scan your code with SonarQube Scanner to detect bugs, vulnerabilities and code smells in more than 25 programming languages."
|
||||
author: "Dwi Siswanto"
|
||||
branding:
|
||||
icon: 'check'
|
||||
color: 'green'
|
||||
icon: "check"
|
||||
color: "green"
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
using: "docker"
|
||||
image: "Dockerfile"
|
||||
inputs:
|
||||
host:
|
||||
description: 'SonarQube server URL'
|
||||
description: "SonarQube server URL"
|
||||
required: true
|
||||
projectBaseDir:
|
||||
description: 'Set the sonar.projectBaseDir analysis property'
|
||||
projectKey:
|
||||
description: "The project's unique key. Allowed characters are: letters, numbers, -, _, . and :, with at least one non-digit."
|
||||
required: false
|
||||
default: '.'
|
||||
default: ""
|
||||
projectBaseDir:
|
||||
description: "Set the sonar.projectBaseDir analysis property"
|
||||
required: false
|
||||
default: "."
|
||||
login:
|
||||
description: 'Login or authentication token of a SonarQube user'
|
||||
description: "Login or authentication token of a SonarQube user"
|
||||
required: true
|
||||
password:
|
||||
description: 'Password that goes with the sonar.login username. This should be left blank if an authentication token is being used.'
|
||||
description: "Password that goes with the sonar.login username. This should be left blank if an authentication token is being used."
|
||||
required: false
|
||||
@ -11,10 +11,11 @@ if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
|
||||
fi
|
||||
|
||||
[[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD=""
|
||||
[[ -z ${INPUT_PROJECTKEY} ]] && SONAR_PROJECTKEY="${PWD##*/}" || SONAR_PROJECTKEY="${INPUT_PROJECTKEY}"
|
||||
|
||||
sonar-scanner \
|
||||
-Dsonar.host.url=${INPUT_HOST} \
|
||||
-Dsonar.projectKey=${PWD##*/} \
|
||||
-Dsonar.projectKey=${SONAR_PROJECTKEY} \
|
||||
-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \
|
||||
-Dsonar.login=${INPUT_LOGIN} \
|
||||
-Dsonar.password=${INPUT_PASSWORD} \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user