Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dotnet9 #35

Merged
merged 12 commits into from
Nov 13, 2024
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.201
FROM mcr.microsoft.com/dotnet/sdk:9.0.100

LABEL "com.github.actions.name"="sonarscan-dotnet"
LABEL "com.github.actions.description"="Sonarscanner for .NET 8 with pull request decoration support."
LABEL "com.github.actions.description"="SonarScanner for .NET 9 with pull request decoration support."
LABEL "com.github.actions.icon"="check-square"
LABEL "com.github.actions.color"="blue"

Expand All @@ -12,9 +12,9 @@ LABEL "homepage"="https://github.com/highbyte"
LABEL "maintainer"="Highbyte"

# Version numbers of used software
ENV SONAR_SCANNER_DOTNET_TOOL_VERSION=6.2 \
ENV SONAR_SCANNER_DOTNET_TOOL_VERSION=9.0.1 \
DOTNETCORE_RUNTIME_VERSION=8.0 \
NODE_VERSION=20 \
NODE_VERSION=22 \
JRE_VERSION=17

# Add Microsoft Debian apt-get feed
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

SonarScanner for .NET for use in Github Actions, with automatic pull request detection, analysis and decoration.

The current version supports .NET 8
The current version supports .NET 9
- For .NET 8, use version [2.3.2](https://github.com/marketplace/actions/sonarscan-dotnet?version=v2.3.2)
- For .NET 7, use version [2.2.6](https://github.com/marketplace/actions/sonarscan-dotnet?version=v2.2.6)
- For .NET 6, use version [2.1.5](https://github.com/marketplace/actions/sonarscan-dotnet?version=v2.1.5)
- For .NET 5, use version [2.0](https://github.com/marketplace/actions/sonarscan-dotnet?version=2.0)
Expand All @@ -16,8 +17,8 @@ The current version supports .NET 8
## Simple use with SonarCloud

``` yaml
- name: SonarScanner for .NET 8 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.3.2
- name: SonarScanner for .NET 9 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.4.0
with:
# The key of the SonarQube project
sonarProjectKey: your_projectkey
Expand All @@ -35,8 +36,8 @@ The current version supports .NET 8
Also includes test results.

``` yaml
- name: SonarScanner for .NET 8 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.3.2
- name: SonarScanner for .NET 9 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.4.0
with:
# The key of the SonarQube project
sonarProjectKey: your_projectkey
Expand All @@ -58,8 +59,8 @@ Also includes test results.
Also includes test results.

``` yaml
- name: SonarScanner for .NET 8 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.3.2
- name: SonarScanner for .NET 9 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.4.0
with:
# The key of the SonarQube project
sonarProjectKey: your_projectkey
Expand All @@ -82,8 +83,8 @@ Also includes test results.
## Skip tests

``` yaml
- name: SonarScanner for .NET 8 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.3.2
- name: SonarScanner for .NET 9 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.4.0
with:
# The key of the SonarQube project
sonarProjectKey: your_projectkey
Expand All @@ -102,8 +103,8 @@ Also includes test results.
## Use pre-build command to add a custom NuGet repository

``` yaml
- name: SonarScanner for .NET 8 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.3.2
- name: SonarScanner for .NET 9 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.4.0
with:
# The key of the SonarQube project
sonarProjectKey: your_projectkey
Expand All @@ -124,8 +125,8 @@ Also includes test results.
## Use with self-hosted SonarQube

``` yaml
- name: SonarScanner for .NET 8 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.3.2
- name: SonarScanner for .NET 9 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.4.0
with:
# The key of the SonarQube project
sonarProjectKey: your_projectkey
Expand Down Expand Up @@ -191,7 +192,7 @@ If the SonarQube/SonarCloud dashboard shows a warning message in the top right (
it can be fixed by modifying the Git checkout action fetch-depth parameter:

``` yaml
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: '0'
```
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "sonarscan-dotnet"
description: "SonarScanner for .NET 8 with pull request decoration support."
description: "SonarScanner for .NET 9 with pull request decoration support."
author: "Highbyte"

inputs:
Expand Down Expand Up @@ -34,7 +34,7 @@ inputs:

runs:
using: "docker"
image: "docker://ghcr.io/highbyte/sonarscan-dotnet:v2.3.2"
image: "docker://ghcr.io/highbyte/sonarscan-dotnet:v2.4.0"

branding:
icon: 'check-square'
Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ echo "INPUT_SONARHOSTNAME: $INPUT_SONARHOSTNAME"
#-----------------------------------
# Build Sonarscanner begin command
#-----------------------------------

sonar_begin_cmd="/dotnet-sonarscanner begin /k:\"${INPUT_SONARPROJECTKEY}\" /n:\"${INPUT_SONARPROJECTNAME}\" /d:sonar.token=\"${SONAR_TOKEN}\" /d:sonar.host.url=\"${INPUT_SONARHOSTNAME}\""
if [ -n "$INPUT_SONARORGANIZATION" ]; then
sonar_begin_cmd="$sonar_begin_cmd /o:\"${INPUT_SONARORGANIZATION}\""
Expand All @@ -106,6 +107,9 @@ if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then

fi

#Skip JRE provisioning in SonarScanner for MSBuild v7.0+. Instead use the JRE provided by the Docker image (which must be in the PATH).
sonar_begin_cmd="$sonar_begin_cmd /d:sonar.scanner.skipJreProvisioning=true"

#-----------------------------------
# Build Sonarscanner end command
#-----------------------------------
Expand Down