Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ jobs:
results_format: sarif
publish_results: false

- name: Filter out CII-Best-Practices from SARIF
- name: Filter and sanitize SARIF
run: |
if ! command -v jq >/dev/null; then
sudo apt-get update && sudo apt-get install -y jq
fi
# Remove results whose ruleId is CII-Best-Practices
jq '(.runs[] .results) |= [ .[] | select(.ruleId != "CII-Best-Practices") ]' results.sarif > filtered.sarif || true
# Also remove results that contain invalid artifactLocation URIs (e.g. "no file associated with this alert")
jq '
(.runs[] .results) |= [
.[]
| select(.ruleId != "CII-Best-Practices")
| select((.locations // []) | all(.physicalLocation?.artifactLocation?.uri?; . != "no file associated with this alert"))
]
' results.sarif > filtered.sarif || true
mv filtered.sarif results.sarif

- name: Upload artifact
Expand Down
Loading