Skip to content

Commit

Permalink
ci: fix clippy's CodeQL messages (#162)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
abrown authored Sep 26, 2024
1 parent 2bbc704 commit b889bab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit b889bab

Please sign in to comment.