mirror of
https://github.com/hohn/sarif-cli.git
synced 2025-12-16 17:23:03 +01:00
Script to add versionControlProvenance
This commit is contained in:
committed by
=Michael Hohn
parent
62ec56948e
commit
9b733e6326
19
bin/sarif-insert-vcp
Executable file
19
bin/sarif-insert-vcp
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Add the versionControlProvenance key to a SARIF file
|
||||||
|
# usage: $0 file
|
||||||
|
uri=vcp-no-uri
|
||||||
|
revid=vcp-no-revid
|
||||||
|
jq ' {"$schema" : ."$schema",
|
||||||
|
"version" : .version,
|
||||||
|
"runs" : [ .runs | .[]
|
||||||
|
| ( .versionControlProvenance |=
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"repositoryUri": "'$uri'",
|
||||||
|
"revisionId": "'$revid'"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
) ]
|
||||||
|
}
|
||||||
|
' $1
|
||||||
|
|
||||||
Reference in New Issue
Block a user