Skip to content

Commit

Permalink
Optimize GitHub Actions workflow by checking if clippy-sarif and sari…
Browse files Browse the repository at this point in the history
…f-fmt are already installed before installing them
  • Loading branch information
niStee committed Jul 27, 2024
1 parent af59afe commit 8edf481
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check_security_vulnerability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Install required cargo
run: |
if ! command -v clippy-sarif &> /dev/null || ! command -v sarif-fmt &> /dev/null; then
if (!(Get-Command clippy-sarif -ErrorAction SilentlyContinue) -or !(Get-Command sarif-fmt -ErrorAction SilentlyContinue)) {
cargo install clippy-sarif sarif-fmt
else
echo "clippy-sarif and sarif-fmt are already installed"
fi
} else {
Write-Output "clippy-sarif and sarif-fmt are already installed"
}
- name: Run rust-clippy
run: |
cargo clippy --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
Expand Down

0 comments on commit 8edf481

Please sign in to comment.