15 Commits

Author SHA1 Message Date
Dwi Siswanto
a40c5bc8f6 ✏️ Remove exit status if event action is push 2020-11-09 22:59:28 +07:00
Dwi Siswanto
7da9810073 🔨 Justify scripts 2020-10-11 19:11:26 +07:00
Dwi Siswanto
276b0c8370 Merge pull request #10 from kitabisa/development
🪲 Use GitHub environment instead of child workdir name as defa…
2020-07-26 06:08:30 +07:00
Dwi Siswanto
6c4cd0d6d9 🪲 Use GitHub environment instead of child workdir name as default value of project key & name 2020-07-26 03:20:28 +07:00
Dwi Siswanto
1c37e4588f 📘 Update usage docs 2020-07-17 09:30:15 +07:00
Dwi Siswanto
545a1a5fac Remove unused variable 2020-07-17 09:30:09 +07:00
Dwi Siswanto
63ca4c2787 Merge pull request #6 from nordcloud/master
Add project identity parameters
2020-07-16 23:36:50 +07:00
Dariusz Dwornikowski
9bdc677f66 Add projectVersion to README 2020-07-16 12:39:56 +02:00
Dariusz Dwornikowski
80213a727e Fix variable assignments 2020-07-16 12:38:54 +02:00
Dariusz Dwornikowski
5379cc65b4 Add setting of projectVersion 2020-07-14 09:45:39 +02:00
Dariusz Dwornikowski
accc346655 Add setting of projectName 2020-07-11 13:06:03 +02:00
dw1
50fbee7c7b ✏️ Fix can't formatting 2020-06-23 06:28:23 +07:00
dw1
d0028cf7df Merge branch 'master' of github.com:kitabisa/sonarqube-action 2020-06-23 06:21:17 +07:00
Dwi Siswanto
5cd2fa569f 📖 Update issue templates 2020-06-23 06:20:31 +07:00
Dwi Siswanto
7b0e7aa29e 📖 Update issue templates 2020-06-23 06:17:36 +07:00
5 changed files with 37 additions and 12 deletions

View File

@@ -1,3 +1,12 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: dwisiswant0
---
### Issue and Steps to Reproduce ### Issue and Steps to Reproduce
<!-- Describe your issue and tell us how to reproduce it (include any useful information). --> <!-- Describe your issue and tell us how to reproduce it (include any useful information). -->
@@ -13,4 +22,4 @@
- Version: - Version:
- Platform: - Platform:
- Subsystem: - Subsystem:

View File

@@ -12,11 +12,13 @@ LABEL maintainer="dwisiswant0"
RUN npm config set unsafe-perm true && \ RUN npm config set unsafe-perm true && \
npm install --silent --save-dev -g typescript@3.5.2 && \ npm install --silent --save-dev -g typescript@3.5.2 && \
npm config set unsafe-perm false npm config set unsafe-perm false && \
apk add --no-cache ca-certificates jq
ENV NODE_PATH "/usr/lib/node_modules/" ENV NODE_PATH "/usr/lib/node_modules/"
RUN apk add --no-cache ca-certificates jq
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -30,13 +30,15 @@ jobs:
login: ${{ secrets.SONARQUBE_TOKEN }} login: ${{ secrets.SONARQUBE_TOKEN }}
``` ```
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: 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 ```yaml
uses: kitabisa/sonarqube-action@master uses: kitabisa/sonarqube-action@master
with: with:
projectBaseDir: my-custom-directory projectBaseDir: "/path/to/my-custom-project"
projectKey: my-custom-project projectKey: "my-custom-project"
projectName: "my-custom-project-name"
projectVersion: "v0.0.1"
``` ```
## Secrets ## Secrets

View File

@@ -15,6 +15,14 @@ inputs:
description: "The project's unique key. Allowed characters are: letters, numbers, -, _, . and :, with at least one non-digit." description: "The project's unique key. Allowed characters are: letters, numbers, -, _, . and :, with at least one non-digit."
required: false required: false
default: "" 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: projectBaseDir:
description: "Set the sonar.projectBaseDir analysis property" description: "Set the sonar.projectBaseDir analysis property"
required: false required: false

View File

@@ -6,20 +6,24 @@ if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
EVENT_ACTION=$(jq -r ".action" "${GITHUB_EVENT_PATH}") EVENT_ACTION=$(jq -r ".action" "${GITHUB_EVENT_PATH}")
if [[ "${EVENT_ACTION}" != "opened" ]]; then if [[ "${EVENT_ACTION}" != "opened" ]]; then
echo "No need to run analysis. It is already triggered by the push event." echo "No need to run analysis. It is already triggered by the push event."
exit 78 exit
fi fi
fi fi
REPOSITORY_NAME=$(basename "${GITHUB_REPOSITORY}")
[[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD="" [[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD=""
[[ -z ${INPUT_PROJECTKEY} ]] && SONAR_PROJECTKEY="${PWD##*/}" || 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_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} \
-Dsonar.projectName=${SONAR_PROJECTNAME} \
-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=${INPUT_PASSWORD} \
-Dsonar.sources=. \ -Dsonar.sources=. \
-Dsonar.sourceEncoding=UTF-8 \ -Dsonar.sourceEncoding=UTF-8
${SONAR_PASSWORD}