From 5347e1cacd91aef4bd600328417ab6e695339763 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Thu, 18 Sep 2025 14:57:31 +0100 Subject: [PATCH] fix: on 404, sbom should be null --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 03ce658..0bdee79 100644 --- a/main.go +++ b/main.go @@ -423,7 +423,10 @@ func (l *GithubReposPlugin) GetRequiredStatusChecks(ctx context.Context, repo *g } func (l *GithubReposPlugin) GatherSBOM(ctx context.Context, repo *github.Repository) (*github.SBOM, error) { - sbom, _, err := l.githubClient.DependencyGraph.GetSBOM(ctx, repo.GetOwner().GetLogin(), repo.GetName()) + sbom, resp, err := l.githubClient.DependencyGraph.GetSBOM(ctx, repo.GetOwner().GetLogin(), repo.GetName()) + if resp.StatusCode == 404 { + return nil, nil + } if err != nil { return nil, err }