Skip to content

Commit

Permalink
Merge pull request #22 from codacy/fix-payload-format
Browse files Browse the repository at this point in the history
add issues-free files to the results list
  • Loading branch information
heliocodacy authored Oct 23, 2024
2 parents 5cc58b7 + b917f8b commit 7152f66
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ func processSarif(sarif Sarif) [][]map[string]interface{} {
}
}
var results []map[string]interface{}
// Iterate through run.Artifacts and create entries in the results object
for _, artifact := range run.Artifacts {
if artifact.Location.URI != "" {
results = append(results, map[string]interface{}{
"filename": artifact.Location.URI,
"results": []map[string]interface{}{},
})
}
}
for _, obj := range codacyIssues {
source := obj["source"].(string)
issue := map[string]interface{}{
Expand Down

0 comments on commit 7152f66

Please sign in to comment.