diff options
-rw-r--r-- | .github/workflows/build.yml | 20 | ||||
-rw-r--r-- | .github/workflows/detekt.yml | 14 |
2 files changed, 20 insertions, 14 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c12349e9..d1af96882 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,26 @@ jobs: - name: Run detekt run: | ./gradlew detekt --stacktrace + - name: Annotate detekt failures + run: | + read -r -d '' jq_command <<'EOF' + .runs[].results[] | + { + "l": .locations[].physicalLocation, + "level": .level, + "message":.message, + "ruleId":.ruleId + } | + ( + "::" + (.level) + + " file=" + ( .l.artifactLocation.uri | sub("file://$(pwd)/"; "")) + + ",line=" + (.l.region.startLine|tostring) + + ",endLine=" + (.l.region.endLine|tostring) + + ",col=" + (.l.region.startColumn|tostring) + + ",endColumn=" + (.l.region.endColumn|tostring) + + ",title=" + (.ruleId) + "::" + (.message.text)) + EOF + jq -r "$jq_command" < versions/1.8.9/build/reports/detekt/detekt.sarif preprocess: diff --git a/.github/workflows/detekt.yml b/.github/workflows/detekt.yml deleted file mode 100644 index 708f9a19e..000000000 --- a/.github/workflows/detekt.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: detekt -on: - - pull_request -jobs: - detekt: - name: Run detekt - runs-on: ubuntu-latest - - steps: - - name: "Checkout project" - uses: actions/checkout@v4 - - - name: "detekt" - uses: natiginfo/action-detekt-all@1.23.7 |