Skip to content

Commit 645a559

Browse files
authored
fix: disable SonarCloud analysis for external pull requests (#1249)
1 parent 8dd206f commit 645a559

File tree

3 files changed

+23
-33
lines changed

3 files changed

+23
-33
lines changed

.github/workflows/ci-analysis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,29 @@ jobs:
6767
./Artifacts/*
6868
./TestResults/*.trx
6969
70+
static-code-analysis:
71+
name: "Static code analysis"
72+
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
73+
runs-on: ubuntu-latest
74+
env:
75+
REPORTGENERATOR_LICENSE: ${{ secrets.REPORTGENERATOR_LICENSE }}
76+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
77+
DOTNET_NOLOGO: true
78+
steps:
79+
- uses: actions/checkout@v4
80+
with:
81+
fetch-depth: 0
82+
- name: Setup .NET SDKs
83+
uses: actions/setup-dotnet@v4
84+
with:
85+
dotnet-version: |
86+
6.0.x
87+
7.0.x
88+
8.0.x
89+
9.0.x
90+
- name: Run sonarcloud analysis
91+
run: ./build.sh CodeAnalysis
92+
7093
publish-test-results:
7194
name: "Publish Tests Results"
7295
needs: [ api-tests, unit-tests ]

System.IO.Abstractions.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
3838
ProjectSection(SolutionItems) = preProject
3939
.github\workflows\build.yml = .github\workflows\build.yml
4040
.github\workflows\ci.yml = .github\workflows\ci.yml
41-
.github\workflows\ci-analysis.yml = .github\workflows\ci-analysis.yml
4241
EndProjectSection
4342
EndProject
4443
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B66A0B3F-6A00-482E-99E2-27D8DECB075E}"

0 commit comments

Comments
 (0)