Skip to content

Commit 7152f66

Browse files
authored
Merge pull request #22 from codacy/fix-payload-format
add issues-free files to the results list
2 parents 5cc58b7 + b917f8b commit 7152f66

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/upload.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ func processSarif(sarif Sarif) [][]map[string]interface{} {
105105
}
106106
}
107107
var results []map[string]interface{}
108+
// Iterate through run.Artifacts and create entries in the results object
109+
for _, artifact := range run.Artifacts {
110+
if artifact.Location.URI != "" {
111+
results = append(results, map[string]interface{}{
112+
"filename": artifact.Location.URI,
113+
"results": []map[string]interface{}{},
114+
})
115+
}
116+
}
108117
for _, obj := range codacyIssues {
109118
source := obj["source"].(string)
110119
issue := map[string]interface{}{

0 commit comments

Comments
 (0)