Compare commits
25 Commits
v1.0.0-rc.
...
v1.1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b87ffe4bf5 | ||
|
|
16486220f2 | ||
|
|
d7e1e2bb60 | ||
|
|
10a365b29a | ||
|
|
8c154cc36b | ||
|
|
c7058a020f | ||
|
|
9b52913486 | ||
|
|
532659cc88 | ||
|
|
c94954550f | ||
|
|
9b7b1d0336 | ||
|
|
a40c5bc8f6 | ||
|
|
7da9810073 | ||
|
|
276b0c8370 | ||
|
|
6c4cd0d6d9 | ||
|
|
1c37e4588f | ||
|
|
545a1a5fac | ||
|
|
63ca4c2787 | ||
|
|
9bdc677f66 | ||
|
|
80213a727e | ||
|
|
5379cc65b4 | ||
|
|
accc346655 | ||
|
|
50fbee7c7b | ||
|
|
d0028cf7df | ||
|
|
5cd2fa569f | ||
|
|
7b0e7aa29e |
@@ -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:
|
||||||
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* @kitabisa/security @dwisiswant0
|
||||||
12
Dockerfile
12
Dockerfile
@@ -1,22 +1,20 @@
|
|||||||
FROM newtmitch/sonar-scanner:4.0.0-alpine
|
FROM sonarsource/sonar-scanner-cli:4
|
||||||
|
|
||||||
LABEL "com.github.actions.name"="SonarQube Scan"
|
LABEL "com.github.actions.name"="SonarQube Scan"
|
||||||
LABEL "com.github.actions.description"="Scan your code with SonarQube Scanner to detect bugs, vulnerabilities and code smells in more than 25 programming languages."
|
LABEL "com.github.actions.description"="Scan your code with SonarQube Scanner to detect bugs, vulnerabilities and code smells in more than 25 programming languages."
|
||||||
LABEL "com.github.actions.icon"="check"
|
LABEL "com.github.actions.icon"="check"
|
||||||
LABEL "com.github.actions.color"="green"
|
LABEL "com.github.actions.color"="green"
|
||||||
|
|
||||||
LABEL version="0.0.1"
|
LABEL version="0.0.2"
|
||||||
LABEL repository="https://github.com/kitabisa/sonarqube-action"
|
LABEL repository="https://github.com/kitabisa/sonarqube-action"
|
||||||
LABEL homepage="https://kitabisa.github.io"
|
LABEL homepage="https://kitabisa.github.io"
|
||||||
LABEL maintainer="dwisiswant0"
|
LABEL maintainer="dwisiswant0"
|
||||||
|
|
||||||
RUN npm config set unsafe-perm true && \
|
|
||||||
npm install --silent --save-dev -g typescript@3.5.2 && \
|
|
||||||
npm config set unsafe-perm false
|
|
||||||
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"]
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -24,19 +24,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: SonarQube Scan
|
- name: SonarQube Scan
|
||||||
uses: kitabisa/sonarqube-action@master
|
uses: kitabisa/sonarqube-action@v1.1.2
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SONARQUBE_HOST }}
|
host: ${{ secrets.SONARQUBE_HOST }}
|
||||||
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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -6,20 +6,32 @@ 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}"
|
|
||||||
|
|
||||||
sonar-scanner \
|
|
||||||
-Dsonar.host.url=${INPUT_HOST} \
|
|
||||||
-Dsonar.projectKey=${SONAR_PROJECTKEY} \
|
|
||||||
-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \
|
|
||||||
-Dsonar.login=${INPUT_LOGIN} \
|
|
||||||
-Dsonar.password=${INPUT_PASSWORD} \
|
|
||||||
-Dsonar.sources=. \
|
|
||||||
-Dsonar.sourceEncoding=UTF-8 \
|
|
||||||
${SONAR_PASSWORD}
|
|
||||||
|
|
||||||
|
if [[ ! -f "${GITHUB_WORKSPACE}/sonar-project.properties" ]]; then
|
||||||
|
[[ -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 \
|
||||||
|
-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=${SONAR_PASSWORD} \
|
||||||
|
-Dsonar.sources=. \
|
||||||
|
-Dsonar.sourceEncoding=UTF-8
|
||||||
|
else
|
||||||
|
sonar-scanner \
|
||||||
|
-Dsonar.host.url=${INPUT_HOST} \
|
||||||
|
-Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} \
|
||||||
|
-Dsonar.login=${INPUT_LOGIN} \
|
||||||
|
-Dsonar.password=${SONAR_PASSWORD}
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user