Skip to content

Detekt

Detekt #56

Workflow file for this run

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: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3
- name: "Setup: JDK 19"
uses: buildjet/setup-java@89ddc594b1d96eada357fc2824610d5d6650f2da # v4
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@23acc5c183826b7a8a97bce3cecc52db901f8251 # v2
continue-on-error: true
with:
sarif_file: ${{ github.workspace }}/detekt.sarif.json
checkout_path: ${{ github.workspace }}