-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Invalid SARIF. Missing 'results' array in run. #1725
Comments
confirmed that the issue presents on |
https://github.com/oxsecurity/megalinter/blob/main/megalinter/reporters/SarifReporter.py#L217 would adding a line like this: run["results"] = [] (i.e., if the conditional on line 203 is false, add an empty list to the If you would rather that in PR form, I can put something together quickly. I opted not to as I'm not sure if it'll actually solve the issue in a way that is acceptable to you, @nvuillam. |
Your proposition of fix is good, you can make. PR if you like , or I'll do it later ^^ |
Ohhh boy!! I get to make a PR!!!! Let's see how badly I can screw this up!!! 🤣 |
GitHub's SARIF validator doesn't like it when there is no `results` list associated with a run; therefore, it a `results` key doesn't exist, create one with an empty list. resolves oxsecurity#1725
* Update SarifReporter.py GitHub's SARIF validator doesn't like it when there is no `results` list associated with a run; therefore, it a `results` key doesn't exist, create one with an empty list. resolves #1725 * Update CHANGELOG.md
Describe the bug
A run of Megalinter (still on
@v6
) spits out an error that the generated SARIF file is invalid with the following, semi-helpful message:I pulled down the megalinter-report.sarif file and used
jq
to determine which item in theruns[]
list is missing aresults
key. It's item 0 (go_revive):The remainder of the items in that
runs[]
list have eitherresults: []
or a dictionary with the relevant results.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Given the error message, I suspect that there ought to be a key with an array of results, even if that array is empty (e.g.,
results: []
).Screenshots
log of an applicable run: https://github.com/IMLS/estimating-wifi/runs/7748715810?check_suite_focus=true#step:11:17
Additional context
(insert flattery here)
I haven't gotten to
oxsecurity/megalinter:beta
(per #1702) yet so this may have been addressed already.The text was updated successfully, but these errors were encountered: