Skip to content

Commit 4a78c96

Browse files
bumahkib7claude
andcommitted
fix: SARIF validation and skip tests in CI security scan
- Fix SARIF validation error: suggestion without artifactChanges - Add --skip-tests to security scan to skip test pattern code Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 90a0efd commit 4a78c96

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,5 @@ jobs:
174174
with:
175175
path: '.'
176176
profile: 'strict'
177+
extra-args: '--skip-tests'
177178
upload-sarif: true

crates/cli/src/output/sarif.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ pub fn output(results: &[FileAnalysis], output_file: Option<PathBuf>) -> Result<
157157
}]
158158
}]);
159159
} else if let Some(suggestion) = &f.suggestion {
160-
// Fall back to simple description-only fix for backward compatibility
161-
result["fixes"] = serde_json::json!([{
162-
"description": {
163-
"text": suggestion
164-
}
165-
}]);
160+
// SARIF spec requires artifactChanges for fixes
161+
// Append suggestion to the message instead
162+
if let Some(text) = result["message"]["text"].as_str() {
163+
result["message"]["text"] =
164+
serde_json::json!(format!("{}\n\nSuggestion: {}", text, suggestion));
165+
}
166166
}
167167

168168
// Add properties with additional metadata

0 commit comments

Comments
 (0)