Skip to content

Commit

Permalink
fix semgrep duplicate rules in sarif
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Jan 21, 2024
1 parent a27c7e0 commit e0d38b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
disable-sudo: true
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: semgrep scan --sarif --output=semgrep.sarif
- run: semgrep scan --sarif --output=results.sarif
env:
SEMGREP_RULES: >-
p/java
Expand All @@ -33,7 +33,10 @@ jobs:
id: check_files
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2.0.0
with:
files: semgrep.sarif
files: results.sarif
- name: Remove duplicate rules
if: steps.check_files.outputs.files_exists == 'true'
run: jq -c '.runs[0].tool.driver.rules |= unique_by(.id)' < results.sarif > semgrep.sarif
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
if: steps.check_files.outputs.files_exists == 'true'
Expand Down

0 comments on commit e0d38b9

Please sign in to comment.