Skip to content

Commit 8bdc3b8

Browse files
committed
Test if token is available
WE2-964 Signed-off-by: Sven Mitt <[email protected]>
1 parent e9d21e6 commit 8bdc3b8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/sonarcloud-analysis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup dotnet
1717
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: 6.0.x # SDK Version to use.
19+
dotnet-version: 8.0.x # SDK Version to use.
2020

2121
- name: Set up JDK 21
2222
uses: actions/setup-java@v4
@@ -55,12 +55,14 @@ jobs:
5555
shell: powershell
5656
run: |
5757
New-Item -Path .\.sonar\scanner -ItemType Directory
58-
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
58+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
59+
dotnet tool install dotnet-sonarscanner --tool-path .\.sonar\scanner --version 10.1.2
5960
6061
- name: Build and analyze
6162
env:
6263
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
6364
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
65+
CACHE_VERSION: ${{ vars.CACHE_VERSION }}
6466
shell: powershell
6567
run: |
6668
Write-Host "Branch: ${{ github.ref_name }}"
@@ -69,8 +71,9 @@ jobs:
6971
if ("${{ secrets.SONAR_TOKEN }}" -eq "") {
7072
Write-Host "SONAR_TOKEN is missing"
7173
} else {
72-
Write-Host "SONAR_TOKEN is available"
74+
Write-Host "SONAR_TOKEN is available -2 (length: $("${{ secrets.SONAR_TOKEN }}".Length))"
7375
}
76+
Remove-Item Env:CACHE_VERSION -ErrorAction SilentlyContinue
7477
.\.sonar\scanner\dotnet-sonarscanner begin /k:"web-eid_web-eid-authtoken-validation-dotnet" /o:"web-eid" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" /d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.verbose=true /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
7578
dotnet build --configuration Release --no-restore src/WebEid.Security.sln
7679
dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"

0 commit comments

Comments
 (0)