File tree 2 files changed +23
-5
lines changed
build-logic/mcbuild/src/main/kotlin
2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -77,15 +77,21 @@ jobs:
77
77
fetch-depth : 0
78
78
79
79
- name : Set up JDK
80
- uses : actions/setup-java@v2
81
- with :
82
- distribution : ' adopt'
83
- java-version : ' 11'
80
+ uses : actions/setup-java@v2
81
+ with :
82
+ distribution : ' adopt'
83
+ java-version : ' 11'
84
84
cache : ' gradle'
85
85
86
86
- name : detekt
87
87
run : ./gradlew detekt --no-daemon
88
88
89
+ - name : Upload SARIF to Github using the upload-sarif action
90
+ uses : github/codeql-action/upload-sarif@v1
91
+ if : success() || failure()
92
+ with :
93
+ sarif_file : build/reports/detekt/merged.sarif
94
+
89
95
ktlint :
90
96
91
97
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 14
14
*/
15
15
16
16
import io.gitlab.arturbosch.detekt.Detekt
17
+ import io.gitlab.arturbosch.detekt.report.ReportMergeTask
17
18
18
19
plugins {
19
20
id(" io.gitlab.arturbosch.detekt" )
20
21
}
21
22
23
+ val reportMerge by tasks.registering(ReportMergeTask ::class ) {
24
+ output.set(rootProject.buildDir.resolve(" reports/detekt/merged.sarif" ))
25
+ }
26
+
22
27
detekt {
23
28
24
29
parallel = true
25
30
config = files(" $rootDir /detekt/detekt-config.yml" )
26
31
buildUponDefaultConfig = true
27
32
}
28
33
29
- tasks.withType<Detekt > {
34
+ tasks.withType<Detekt > detekt@{
35
+
36
+ finalizedBy(reportMerge)
37
+
38
+ reportMerge.configure {
39
+ input.from(this @detekt.sarifReportFile)
40
+ }
30
41
31
42
reports {
32
43
xml.required.set(true )
33
44
html.required.set(true )
34
45
txt.required.set(false )
46
+ sarif.required.set(true )
35
47
}
36
48
37
49
setSource(files(projectDir))
You can’t perform that action at this time.
0 commit comments