Skip to content

Commit 17a44b0

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

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/sonarcloud-analysis.yml

Lines changed: 5 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,13 @@ 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 install dotnet-sonarscanner --tool-path .\.sonar\scanner --version 10.1.2
5959
6060
- name: Build and analyze
6161
env:
6262
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
6363
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+
CACHE_VERSION: ${{ vars.CACHE_VERSION }}
6465
shell: powershell
6566
run: |
6667
Write-Host "Branch: ${{ github.ref_name }}"
@@ -69,8 +70,9 @@ jobs:
6970
if ("${{ secrets.SONAR_TOKEN }}" -eq "") {
7071
Write-Host "SONAR_TOKEN is missing"
7172
} else {
72-
Write-Host "SONAR_TOKEN is available"
73+
Write-Host "SONAR_TOKEN is available -3 (length: $("${{ secrets.SONAR_TOKEN }}".Length))"
7374
}
75+
Remove-Item Env:CACHE_VERSION -ErrorAction SilentlyContinue
7476
.\.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"
7577
dotnet build --configuration Release --no-restore src/WebEid.Security.sln
7678
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)