forked from buildless/plugin-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 2.04 KB
/
module.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Detekt
on:
schedule:
- cron: "39 6 * * 2"
workflow_call:
secrets:
## Secrets: Buildless API key
BUILDLESS_APIKEY:
required: true
description: "Buildless API key"
workflow_dispatch:
secrets:
BUILDLESS_APIKEY:
required: true
description: "Buildless API key"
env:
DETEKT_RELEASE_TAG: v1.23.0
jobs:
scan:
name: Detekt
runs-on: ubuntu-latest
steps:
- name: "Setup: Checkout"
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: "Setup: JDK 19"
uses: buildjet/setup-java@3b5edd4799eb848d92664003cb1e6f74db868f19 # v3
with:
distribution: "adopt-hotspot"
java-version: "19"
- name: "Setup: Detekt"
continue-on-error: true
run: |
dest=$( mktemp -d )
curl --request GET \
--url https://github.com/detekt/detekt/releases/download/v1.23.0/detekt-cli-1.23.0-all.jar \
--silent \
--location \
--output $dest/detekt
chmod a+x $dest/detekt
echo $dest >> $GITHUB_PATH
- name: "Analysis: Detekt"
continue-on-error: true
run: |
detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json
- name: "Fixup: SARIF Locations"
continue-on-error: true
run: |
echo "$(
jq \
--arg github_workspace ${{ github.workspace }} \
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
${{ github.workspace }}/detekt.sarif.json
)" > ${{ github.workspace }}/detekt.sarif.json
- name: "Report: SARIF Upload"
uses: github/codeql-action/upload-sarif@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2
continue-on-error: true
with:
sarif_file: ${{ github.workspace }}/detekt.sarif.json
checkout_path: ${{ github.workspace }}