diff --git a/.github/workflows/check_security_vulnerability.yml b/.github/workflows/check_security_vulnerability.yml index ca1650ca..434e42c1 100644 --- a/.github/workflows/check_security_vulnerability.yml +++ b/.github/workflows/check_security_vulnerability.yml @@ -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