Skip to content

Commit

Permalink
debug: what going on in the sarif payload
Browse files Browse the repository at this point in the history
  • Loading branch information
blackheaven committed Aug 18, 2024
1 parent d6644ae commit a8b568d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ sendAdvisories ghContext packageAdvisories = do
},
runArtifacts = mempty -- TODO cabal files/lock?
}
sarifLog = defaultLog {logRuns = [run]}
lbsSharifLog = encodeSarifAsLBS sarifLog
gzippedsharifLog = compress lbsSharifLog
base64GzippedSarifLog = extractBase64 $ encodeBase64 gzippedsharifLog

putStrLn "sarifLog"
print sarifLog
putStrLn "lbsSharifLog"
B.putStrLn lbsSharifLog
putStrLn "base64GzippedSarifLog"
B.putStrLn base64GzippedSarifLog

let ghSettings =
GitHubSettings
Expand All @@ -184,7 +195,7 @@ sendAdvisories ghContext packageAdvisories = do
ghData =
[ "ref" := ghContext.ref,
"commit_sha" := ghContext.commitSha,
"sarif" := extractBase64 (encodeBase64 $ compress $ encodeSarifAsLBS defaultLog {logRuns = [run]}),
"sarif" := base64GzippedSarifLog,
"tool_name" := ("github-action-scan" :: Text),
"validate" := True
]
Expand Down

0 comments on commit a8b568d

Please sign in to comment.