Skip to content

Commit 980f7d6

Browse files
puercosteiza
authored andcommitted
Add document describes to fix lingering elements
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
1 parent e002c21 commit 980f7d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/spdx/spdx.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type Doc struct {
4545
CreationInfo CreationInfo `json:"creationInfo"`
4646
Packages []Package `json:"packages"`
4747
Relationships []Relationship `json:"relationships"`
48+
DocumentDescribes []string `json:"documentDescribes"`
4849
}
4950

5051
func MakeDoc(host, owner, name string, packages []Package) Doc {
@@ -82,13 +83,14 @@ func MakeDoc(host, owner, name string, packages []Package) Doc {
8283
Creators: []string{"Organization: GitHub, Inc", "Tool: gh-sbom"},
8384
Created: time.Now().UTC().Format("2006-01-02T15:04:05Z"),
8485
},
85-
Relationships: []Relationship{},
86-
Packages: append([]Package{mainPackage}, packages...),
86+
Relationships: []Relationship{},
87+
Packages: append([]Package{mainPackage}, packages...),
88+
DocumentDescribes: []string{mainPackage.SPDXID},
8789
}
8890

8991
for _, p := range doc.Packages {
9092
doc.Relationships = append(doc.Relationships, Relationship{
91-
Element: "SPDXRef-mainPackage",
93+
Element: mainPackage.SPDXID,
9294
Type: "DEPENDS_ON",
9395
Related: p.SPDXID,
9496
})

0 commit comments

Comments
 (0)