Skip to content

Commit

Permalink
render/sarif: create valid sarif results output file
Browse files Browse the repository at this point in the history
Existing output seems not to be valid. This PR adds required fields in the output file.

Fixes #559
  • Loading branch information
ppawlowski authored and zegl committed Dec 22, 2023
1 parent 2460a44 commit b2e4141
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion renderer/sarif/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@ func Output(input *scorecard.Scorecard) io.Reader {
Rules: rules,
},
},
Results: results,
Conversion: sarif.Conversion{
Tool: sarif.Tool{
Driver: sarif.Driver{
Name: "kube-score", },
},
Invocation: sarif.Invocation{

},
},
Results: results,
}
res := sarif.Sarif{
Runs: []sarif.Run{run},
Expand Down
2 changes: 1 addition & 1 deletion sarif/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type WorkingDirectory struct {

type Invocation struct {
Arguments []string `json:"arguments,omitempty"`
ExecutionSuccessful bool `json:"executionSuccessful,omitempty"`
ExecutionSuccessful bool `json:"executionSuccessful"`
CommandLine string `json:"commandLine,omitempty"`
EndTimeUtc time.Time `json:"endTimeUtc,omitempty"`
WorkingDirectory WorkingDirectory `json:"workingDirectory,omitempty"`
Expand Down

0 comments on commit b2e4141

Please sign in to comment.