Skip to content

Commit e2ee65c

Browse files
committed
ci: upload detekt results to GitHub code scanning
Includes detect results in the GitHub code scanning feature. That way, we receive inline annotations in PRs on detected problems.
1 parent 6e409dc commit e2ee65c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
arguments: |
2929
--build-cache
3030
build
31+
detekt
3132
-PciBuild=true
3233
- name: Archive test report
3334
uses: actions/upload-artifact@v3
@@ -37,6 +38,17 @@ jobs:
3738
path: |
3839
*/build/test-results
3940
*/build/reports
41+
# In theory, the upload action should take care of stripping the GitHub
42+
# runner workspace path from the file paths. But somehow that doesn't
43+
# work. So do it manually.
44+
- name: relativize SARIF file paths
45+
run: |
46+
sed -i 's#${{ github.workspace }}/##' build/reports/detekt/*.sarif
47+
- name: Upload SARIF file
48+
uses: github/codeql-action/upload-sarif@v2
49+
with:
50+
sarif_file: 'build/reports/detekt/'
51+
category: detekt
4052

4153
test-model-api-gen-gradle:
4254
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)