File tree 4 files changed +43
-19
lines changed
4 files changed +43
-19
lines changed Original file line number Diff line number Diff line change 1
1
FROM sonarsource/sonar-scanner-cli:4.3
2
2
3
- LABEL version="0.0.1"
4
- LABEL repository="https://github.com/sonarsource/sonarcloud-github-action"
5
- LABEL homepage="https://github.com/sonarsource/sonarcloud-github-action"
6
- LABEL maintainer="SonarSource"
7
- LABEL " com.github.actions.name" ="SonarCloud Scan"
8
- LABEL " com.github.actions.description" ="Scan your code with SonarCloud to detect bugs, vulnerabilities and code smells in more than 25 programming languages."
9
- LABEL " com.github.actions.icon" ="check"
10
- LABEL " com.github.actions.color" ="green"
3
+ LABEL version="0.0.1" \
4
+ repository="https://github.com/sonarsource/sonarcloud-github-action" \
5
+ homepage="https://github.com/sonarsource/sonarcloud-github-action" \
6
+ maintainer="SonarSource" \
7
+ com.github.actions.name="SonarCloud Scan" \
8
+ com.github.actions.description="Scan your code with SonarCloud to detect bugs, vulnerabilities and code smells in more than 25 programming languages." \
9
+ com.github.actions.icon="check" \
10
+ com.github.actions.color="green"
11
11
12
12
ARG SONAR_SCANNER_HOME=/opt/sonar-scanner
13
13
ARG NODEJS_HOME=/opt/nodejs
@@ -19,6 +19,7 @@ WORKDIR /opt
19
19
# https://help.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
20
20
USER root
21
21
22
+ # Prepare entrypoint
22
23
COPY entrypoint.sh /entrypoint.sh
23
24
RUN chmod +x /entrypoint.sh
24
25
ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change 59
59
projectBaseDir: my-custom-directory
60
60
` ` `
61
61
62
+ In case you need to add additional analysis parameters, you can use the `args` option :
63
+
64
+ ` ` ` yaml
65
+ - name: Analyze with SonarCloud
66
+ uses: sonarsource/sonarcloud-github-action@master
67
+ with:
68
+ projectBaseDir: my-custom-directory
69
+ args: >
70
+ -Dsonar.organization=my-organization
71
+ -Dsonar.projectKey=my-projectkey
72
+ -Dsonar.python.coverage.reportPaths=coverage.xml
73
+ -Dsonar.sources=lib/
74
+ -Dsonar.test.exclusions=tests/**
75
+ -Dsonar.tests=tests/
76
+ -Dsonar.verbose=true
77
+ ` ` `
78
+
79
+ More information about possible analysis parameters is found in the documentation at :
80
+ https://sonarcloud.io/documentation/analysis/analysis-parameters/
81
+
62
82
# ## Secrets
63
83
64
84
- ` SONAR_TOKEN` – **Required** this is the token used to authenticate access to SonarCloud. You can generate a token on your [Security page in SonarCloud](https://sonarcloud.io/account/security/). You can set the `SONAR_TOKEN` environment variable in the "Secrets" settings page of your repository.
Original file line number Diff line number Diff line change 1
- name : ' SonarCloud Scan'
2
- description : ' Scan your code with SonarCloud to detect bugs, vulnerabilities and code smells in more than 25 programming languages.'
1
+ name : SonarCloud Scan
2
+ description : >
3
+ Scan your code with SonarCloud to detect bugs, vulnerabilities and code smells
4
+ in more than 25 programming languages.
3
5
branding :
4
- icon : ' check'
5
- color : ' green'
6
+ icon : check
7
+ color : green
6
8
runs :
7
- using : ' docker'
8
- image : ' Dockerfile'
9
+ using : docker
10
+ image : Dockerfile
9
11
inputs :
12
+ args :
13
+ description : Additional arguments to the sonarcloud scanner
14
+ required : false
10
15
projectBaseDir :
11
- description : ' Set the sonar.projectBaseDir analysis property'
16
+ description : Set the sonar.projectBaseDir analysis property
12
17
required : false
13
- default : ' . '
18
+ default : .
Original file line number Diff line number Diff line change @@ -21,6 +21,4 @@ if [[ -z "${SONARCLOUD_URL}" ]]; then
21
21
SONARCLOUD_URL=" https://sonarcloud.io"
22
22
fi
23
23
24
- sonar-scanner -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} -Dsonar.host.url=${SONARCLOUD_URL}
25
-
26
-
24
+ sonar-scanner -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} -Dsonar.host.url=${SONARCLOUD_URL} ${INPUT_ARGS}
You can’t perform that action at this time.
0 commit comments