Skip to content

Commit 8dd206f

Browse files
authored
fix: use workflow_run target for static code analysis (#1248)
* fix: use `workflow_run` target for static code analysis
1 parent 6c5af27 commit 8dd206f

File tree

3 files changed

+33
-23
lines changed

3 files changed

+33
-23
lines changed

.github/workflows/ci-analysis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI-Analysis
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows: [ "CI" ]
7+
types:
8+
- completed
9+
10+
jobs:
11+
static-code-analysis:
12+
name: "Static code analysis"
13+
if: ${{ github.actor != 'dependabot[bot]' }}
14+
runs-on: ubuntu-latest
15+
env:
16+
REPORTGENERATOR_LICENSE: ${{ secrets.REPORTGENERATOR_LICENSE }}
17+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
18+
DOTNET_NOLOGO: true
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Setup .NET SDKs
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: |
27+
6.0.x
28+
7.0.x
29+
8.0.x
30+
9.0.x
31+
- name: Run sonarcloud analysis
32+
run: ./build.sh CodeAnalysis

.github/workflows/ci.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,6 @@ jobs:
6767
./Artifacts/*
6868
./TestResults/*.trx
6969
70-
static-code-analysis:
71-
name: "Static code analysis"
72-
if: ${{ github.actor != 'dependabot[bot]' }}
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-
9370
publish-test-results:
9471
name: "Publish Tests Results"
9572
needs: [ api-tests, unit-tests ]

System.IO.Abstractions.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ 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
4142
EndProjectSection
4243
EndProject
4344
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B66A0B3F-6A00-482E-99E2-27D8DECB075E}"

0 commit comments

Comments
 (0)