Skip to content

Commit bf3310b

Browse files
fix: improve CodeQL findings table readability
- Rename "Security" column to "Sec-Sev" for clarity - Increase message truncation from 80 to 120 characters
1 parent 83b21c6 commit bf3310b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ jobs:
172172
echo "<details>" >> $GITHUB_STEP_SUMMARY
173173
echo "<summary>View $RESULTS finding(s)</summary>" >> $GITHUB_STEP_SUMMARY
174174
echo "" >> $GITHUB_STEP_SUMMARY
175-
echo "| Level | Security | Rule | Location | Message |" >> $GITHUB_STEP_SUMMARY
176-
echo "|-------|----------|------|----------|---------|" >> $GITHUB_STEP_SUMMARY
175+
echo "| Level | Sec-Sev | Rule | Location | Message |" >> $GITHUB_STEP_SUMMARY
176+
echo "|-------|---------|------|----------|---------|" >> $GITHUB_STEP_SUMMARY
177177
# Join results with rules to get security-severity (which is on rule definitions, not results)
178178
jq -r '
179179
(.runs[0].tool.driver.rules // []) as $driver_rules |
180180
([.runs[0].tool.extensions[]?.rules // []] | add // []) as $ext_rules |
181181
($driver_rules + $ext_rules | map({(.id): (.properties["security-severity"] // null)}) | add // {}) as $severities |
182182
.runs[0].results[] |
183-
"| \(.level // "warning") | \($severities[.ruleId] // "N/A") | \(.ruleId // "unknown") | `\(.locations[0].physicalLocation.artifactLocation.uri // "unknown"):\(.locations[0].physicalLocation.region.startLine // "?")` | \(.message.text | gsub("\n"; " ") | gsub("\\|"; "\\\\|") | .[0:80]) |"
183+
"| \(.level // "warning") | \($severities[.ruleId] // "N/A") | \(.ruleId // "unknown") | `\(.locations[0].physicalLocation.artifactLocation.uri // "unknown"):\(.locations[0].physicalLocation.region.startLine // "?")` | \(.message.text | gsub("\n"; " ") | gsub("\\|"; "\\\\|") | .[0:120]) |"
184184
' "$sarif" >> $GITHUB_STEP_SUMMARY
185185
echo "" >> $GITHUB_STEP_SUMMARY
186186
echo "</details>" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)