Skip to content

Commit 0aa142c

Browse files
committed
Set Sonar project version using MinVer.
1 parent af41ce4 commit 0aa142c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
run: |
4848
New-Item -Path .\.sonar\scanner -ItemType Directory
4949
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
50+
- name: Install minver
51+
run: dotnet tool install --global minver-cli
5052
- name: Restore Packages
5153
run: dotnet restore
5254
- name: Build and analyze
@@ -55,6 +57,7 @@ jobs:
5557
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5658
shell: powershell
5759
run: |
58-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"mysql-net_MySqlConnector" /o:"mysql-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
60+
$sonarProjectVersion = minver
61+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"mysql-net_MySqlConnector" /o:"mysql-net" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.projectVersion="$sonarProjectVersion"
5962
dotnet build --configuration Release --no-restore
6063
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)