diff options
author | Linnea Gräf <nea@nea.moe> | 2024-09-19 21:15:37 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-09-19 21:15:37 +0200 |
commit | ab19e365c1962db5d94b2cc713ab9216024fc80d (patch) | |
tree | b6063fd089282c5c71cb093e50a01c540ce04c0c | |
parent | 3724cbcfd774bae43f6fc3ac3f561922fcb2a5fa (diff) | |
download | skyhanni-ab19e365c1962db5d94b2cc713ab9216024fc80d.tar.gz skyhanni-ab19e365c1962db5d94b2cc713ab9216024fc80d.tar.bz2 skyhanni-ab19e365c1962db5d94b2cc713ab9216024fc80d.zip |
Add inline warning and errors to github actions
-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 |