@@ -26,21 +26,29 @@ export function createSarifOutputForOpenSource(
26
26
$schema :
27
27
'https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json' ,
28
28
version : '2.1.0' ,
29
- runs : testResults . map ( replaceLockfileWithManifest ) . map ( ( testResult ) => ( {
30
- tool : {
31
- driver : {
32
- name : 'Snyk Open Source' ,
33
- semanticVersion : getVersion ( ) ,
34
- version : getVersion ( ) ,
35
- informationUri : 'https://docs.snyk.io/' ,
36
- properties : {
37
- artifactsScanned : testResult . dependencyCount ,
29
+ runs : testResults . map ( replaceLockfileWithManifest ) . map ( ( testResult ) => {
30
+ const projectName = testResult ?. projectName ;
31
+ const projectIdentifier = projectName ? `${ projectName } /` : '' ;
32
+
33
+ return {
34
+ tool : {
35
+ driver : {
36
+ name : 'Snyk Open Source' ,
37
+ semanticVersion : getVersion ( ) ,
38
+ version : getVersion ( ) ,
39
+ informationUri : 'https://docs.snyk.io/' ,
40
+ properties : {
41
+ artifactsScanned : testResult . dependencyCount ,
42
+ } ,
43
+ rules : getRules ( testResult ) ,
38
44
} ,
39
- rules : getRules ( testResult ) ,
40
45
} ,
41
- } ,
42
- results : getResults ( testResult ) ,
43
- } ) ) ,
46
+ automationDetails : {
47
+ id : `Snyk/Open Source/${ projectIdentifier } ${ new Date ( ) . toISOString ( ) } ` ,
48
+ } ,
49
+ results : getResults ( testResult ) ,
50
+ } ;
51
+ } ) ,
44
52
} ;
45
53
}
46
54
0 commit comments