Skip to content

Commit 7371f8d

Browse files
author
Adnan Bal
committed
Add ReviewDog
1 parent 70080c1 commit 7371f8d

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/android.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ jobs:
5151
path: app/build/reports/lint-results-debug.html
5252

5353
- name: Run Detekt
54-
run: ./gradlew detekt
54+
run: ./gradlew detekt || true
55+
56+
- name: Reviewdog (Detekt SARIF)
57+
if: github.event_name == 'pull_request'
58+
uses: reviewdog/action-sarif@v1
59+
with:
60+
sarif_file: app/build/reports/detekt/detekt.sarif
61+
reporter: github-pr-review
62+
fail_on_error: true
5563

5664
- name: Detekt PR Comment
5765
if: failure() && github.event_name == 'pull_request'

app/build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
plugins {
23
alias(libs.plugins.android.application)
34
alias(libs.plugins.kotlin.android)
@@ -10,14 +11,16 @@ detekt {
1011
buildUponDefaultConfig = true
1112
allRules = false
1213
baseline = file("$projectDir/config/detekt/baseline.xml")
14+
}
15+
16+
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
1317
reports {
1418
xml.required.set(true)
1519
html.required.set(true)
1620
txt.required.set(true)
21+
sarif.required.set(true)
1722
}
18-
}
1923

20-
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
2124
val compileKotlinDebug = tasks.findByName("compileDebugKotlin") as? org.jetbrains.kotlin.gradle.tasks
2225
.KotlinCompile
2326
if (compileKotlinDebug != null) {

0 commit comments

Comments
 (0)