From b889babe484c7aace62d2eb533956c0572aced40 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 26 Sep 2024 10:57:30 -0700 Subject: [PATCH] ci: fix clippy's CodeQL messages (#162) * ci: fix clippy's CodeQL messages Looking at the first Rust code scan issue ([#1]), it looks like it can't show the preview because of a directory issue. Because the Rust crates are in a sub-directory, `rust`, to get proper previews we need to prepend that directory, accomplished here by a simple `sed` replacement. [#1]: https://github.com/intel/ittapi/security/code-scanning/1 * Change directories for tasks --- .github/workflows/codeql.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c2beae4..dbf1405 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -75,9 +75,6 @@ jobs: analyze_rust: name: Analyze (Rust) runs-on: ubuntu-latest - defaults: - run: - working-directory: rust permissions: contents: read security-events: write @@ -95,12 +92,16 @@ jobs: run: cargo binstall --no-confirm clippy-sarif sarif-fmt - name: Run clippy + working-directory: rust run: | cargo clippy --all-features --message-format=json > clippy.json + sed --in-place 's/"file_name":"itt/"file_name":"rust\/itt/g' clippy.json clippy-sarif --input clippy.json --output clippy.sarif - sarif-fmt --input clippy.sarif continue-on-error: true + - name: Print SARIF + run: sarif-fmt --input rust/clippy.sarif + - name: Upload analysis uses: github/codeql-action/upload-sarif@v3 with: