mirror of
https://github.com/sonarsource/sonarcloud-github-action.git
synced 2026-06-06 13:47:09 +00:00
Add support of project base dir from env
This commit is contained in:
parent
e48f96aa27
commit
c7f7c25d41
3 changed files with 15 additions and 2 deletions
10
README.md
10
README.md
|
|
@ -4,7 +4,7 @@ Using this GitHub Action, scan your code with [SonarCloud](https://sonarcloud.io
|
|||
|
||||
<img src="./images/SonarCloud-72px.png">
|
||||
|
||||
SonarCloud is the leading product for Continuous Code Quality & Code Security online, totally free for open-source projects. It supports all major programming languages, including Java, JavaScript, TypeScript, C#, C/C++ and many more. If your code is closed source, SonarCloud also offers a paid plan to run private analyses
|
||||
SonarCloud is the leading product for Continuous Code Quality & Code Security online, totally free for open-source projects. It supports all major programming languages, including Java, JavaScript, TypeScript, C#, C/C++ and many more. If your code is closed source, SonarCloud also offers a paid plan to run private analyses.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
|
@ -24,6 +24,14 @@ sonar.projectKey=<replace with the key generated when setting up the project on
|
|||
sonar.sources=.
|
||||
```
|
||||
|
||||
You can change the analysis base directory by using the optional input `projectBaseDir` like this:
|
||||
|
||||
```yaml
|
||||
uses: sonarsource/sonarcloud-github-action@master
|
||||
with:
|
||||
projectBaseDir: my-custom-directory
|
||||
```
|
||||
|
||||
The workflow, usually declared in `.github/workflows/build.yml`, looks like:
|
||||
|
||||
```yaml
|
||||
|
|
|
|||
|
|
@ -6,3 +6,8 @@ branding:
|
|||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
inputs:
|
||||
projectBaseDir:
|
||||
description: 'Set the sonar.projectBaseDir analysis property'
|
||||
required: false
|
||||
default: '.'
|
||||
|
|
@ -29,6 +29,6 @@ if [[ -z "${SONARCLOUD_URL}" ]]; then
|
|||
SONARCLOUD_URL="https://sonarcloud.io"
|
||||
fi
|
||||
|
||||
sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL}
|
||||
sonar-scanner -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} -Dsonar.host.url=${SONARCLOUD_URL}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue