From 867cb0e5db65051be1063738eae7d1b086e5b627 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 7 May 2024 02:56:32 -0400 Subject: [PATCH] - replaces sonar login by token (#2043) * - replaces sonar login by token * - removes unecessary end token * - removes caching due to invalidation problems --- .github/workflows/sonarcloud.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 75ebb0eae..9ee07e96c 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -57,26 +57,15 @@ jobs: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache SonarCloud scanner - id: cache-sonar-scanner - uses: actions/cache@v4 - with: - path: ./.sonar/scanner - key: ${{ runner.os }}-sonar-scanner - restore-keys: ${{ runner.os }}-sonar-scanner - name: Install SonarCloud scanner - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' - shell: pwsh - run: | - New-Item -Path ./.sonar/scanner -ItemType Directory - dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner + run: dotnet tool install dotnet-sonarscanner --create-manifest-if-needed - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} shell: pwsh run: | - ./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoftgraph_microsoft-graph-devx-api" /o:"microsoftgraph2" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" + dotnet tool run dotnet-sonarscanner begin /k:"microsoftgraph_microsoft-graph-devx-api" /o:"microsoftgraph2" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" dotnet build dotnet test MSGraphWebApi.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" + dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"