git CLI output mangles stdout when output format is supposed to be JSON during repository scans #7544
Closed
therealpxc
started this conversation in
Bugs
Replies: 1 comment
-
Thanks. Created #7547 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
trivy repository --format cyclonedx ... <URI>
is not usable in shell pipelines.Desired Behavior
When a
--format
option is set, all that appears on stdout should be parseable as a valid entity in that format.Actual Behavior
Even when a
--format
option is set,git
command line output and other messages end up in stdout, so stdout doesn't parse in the specified format.Reproduction Steps
In a Git repository (an empty one if you like, doesn't matter), compare the output of
(which works correctly) to the output of
which fails because jq can't parse stdout, which is not valid json on account of containing errant
git
output.You can observe the same thing with actually-remote git repos, too; it just takes longer:
Target
Git Repository
Scanner
Vulnerability
Output Format
None
Mode
Standalone
Debug Output
Operating System
macOS Sonoma
Version
Checklist
trivy clean --all
Beta Was this translation helpful? Give feedback.
All reactions