From a43a16961fb4cc03972814ed16adb5243d79063e Mon Sep 17 00:00:00 2001 From: Allen Shearin Date: Wed, 6 Mar 2024 16:15:50 -0700 Subject: [PATCH] correct issues Signed-off-by: Allen Shearin --- checks/raw/sbom.go | 11 +++++++++-- clients/git/client.go | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/checks/raw/sbom.go b/checks/raw/sbom.go index 4702e7f988b..6934617c3fc 100644 --- a/checks/raw/sbom.go +++ b/checks/raw/sbom.go @@ -16,6 +16,7 @@ package raw import ( "fmt" + "io" "regexp" "slices" @@ -110,13 +111,19 @@ func checkSbomStandard(c *checker.CheckRequest, fileList []string) (*checker.Sbo standardsFileName := fileList[idx] - contents, err := c.RepoClient.GetFileContent(standardsFileName) + reader, err := c.RepoClient.GetFileReader(standardsFileName) if err != nil { - return nil, fmt.Errorf("error getting fileContent in checkSbomStandard: %w", err) + return nil, fmt.Errorf("error getting filereader in checkSbomStandard: %w", err) } securityInsightsFile := clients.SecurityInsightsSchema{} + contents, err := io.ReadAll(reader) + reader.Close() + if err != nil { + return nil, fmt.Errorf("error getting fileContent in checkSbomStandard: %w", err) + } + err = yaml.Unmarshal(contents, &securityInsightsFile) if err != nil { return nil, fmt.Errorf("error parsing security insights file: %w", err) diff --git a/clients/git/client.go b/clients/git/client.go index f530cc7c82a..3d42cd21011 100644 --- a/clients/git/client.go +++ b/clients/git/client.go @@ -362,6 +362,10 @@ func (c *Client) ListCheckRunsForRef(ref string) ([]clients.CheckRun, error) { return nil, clients.ErrUnsupportedFeature } +func (c *Client) ListSboms() ([]clients.Sbom, error) { + return nil, clients.ErrUnsupportedFeature +} + func (c *Client) ListStatuses(ref string) ([]clients.Status, error) { return nil, clients.ErrUnsupportedFeature }