-
Notifications
You must be signed in to change notification settings - Fork 18
42 lines (37 loc) · 1.18 KB
/
detekt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: "Run Detekt and upload SARIF"
on:
push:
branches:
- main
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
with-type-resolution:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run analysis
run: ./gradlew detektMain detektTest --continue
# Make sure we always run this upload task,
# because the previous step may fail if there are findings.
- name: Upload SARIF to Github using the upload-sarif action
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/reports/detekt/detekt.sarif
# Optional category for the results
# Used to differentiate multiple results for one commit
category: detekt