diff --git a/.gitea/workflows/sonarqube.yml b/.gitea/workflows/sonarqube.yml index aa25f06..301617a 100644 --- a/.gitea/workflows/sonarqube.yml +++ b/.gitea/workflows/sonarqube.yml @@ -54,5 +54,23 @@ jobs: - name: Build run: dotnet build Strata.SqlTools.QueryBreakdown.sln --configuration Release + - name: Test plugins endpoint from runner + run: | + echo "Test 1: curl with token via Basic auth" + curl -s -w "\nHTTP %{http_code}\n" \ + -u "${{ secrets.SONAR_TOKEN }}:" \ + "${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2 + echo "---" + echo "Test 2: curl with token via Bearer auth" + curl -s -w "\nHTTP %{http_code}\n" \ + -H "Authorization: Bearer ${{ secrets.SONAR_TOKEN }}" \ + "${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2 + echo "---" + echo "Test 3: same Java User-Agent the scanner uses" + curl -s -w "\nHTTP %{http_code}\n" \ + -u "${{ secrets.SONAR_TOKEN }}:" \ + -H "User-Agent: ScannerCLI/5.0.2.4997" \ + "${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2 + - name: SonarScanner End run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"