4 Commits

Author SHA1 Message Date
dw1
a1521f09b4 📝 Update usage docs 2020-06-23 05:59:44 +07:00
dw1
c9f1220abc 📖 Add pull request template 2020-06-23 05:59:36 +07:00
dw1
ecb9a772a9 📖 Add issue template 2020-06-23 05:59:27 +07:00
dw1
bb543d0f7a 🪲 Add dynamic projectKey input. Fixes #5 2020-06-23 05:59:03 +07:00
5 changed files with 74 additions and 15 deletions

16
ISSUE_TEMPLATE.md Normal file
View File

@@ -0,0 +1,16 @@
### Issue and Steps to Reproduce
<!-- Describe your issue and tell us how to reproduce it (include any useful information). -->
### Versions
### Screenshots
#### Expected
#### Actual
### Specifications
- Version:
- Platform:
- Subsystem:

37
PULL_REQUEST_TEMPLATE.md Normal file
View File

@@ -0,0 +1,37 @@
THIS PROJECT IS IN MAINTENANCE MODE. We accept pull-requests for Bug Fixes **ONLY**. NO NEW FEATURES ACCEPTED!
---
<!--- Provide a general summary of your changes in the Title above -->
### Description
<!--- Describe your changes in detail -->
### Related Issue
Fixes #
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->
### Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
### Types of Changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] ~New feature (non-breaking change which adds functionality)~
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] All new and existing tests passed.
### How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
### Screenshots (if appropriate):

View File

@@ -30,12 +30,13 @@ jobs:
login: ${{ secrets.SONARQUBE_TOKEN }}
```
You can change the analysis base directory by using the optional input `projectBaseDir` like this:
You can change the analysis base directory and/ project key _(allowed characters: letters, numbers, -, _, . and :, with at least one non-digit.)_ by using the optional input like this:
```yaml
uses: kitabisa/sonarqube-action@master
with:
projectBaseDir: my-custom-directory
projectKey: my-custom-project
```
## Secrets

View File

@@ -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

View File

@@ -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} \