From 80ac7163e97038baba1a65a86045cb8697938ea6 Mon Sep 17 00:00:00 2001 From: Spencer Schrock Date: Wed, 23 Aug 2023 11:10:50 -0700 Subject: [PATCH] :bug: fallback to local file detection on empty GitHub license response. (#3412) Signed-off-by: Spencer Schrock Signed-off-by: Allen Shearin --- checks/raw/license.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/checks/raw/license.go b/checks/raw/license.go index 618d24fa027..4375c1a3c9a 100644 --- a/checks/raw/license.go +++ b/checks/raw/license.go @@ -116,6 +116,11 @@ func License(c *checker.CheckRequest) (checker.LicenseData, error) { // repo API for licenses is supported // go the work and return from immediate (no searching repo). case lerr == nil: + // licenses API may be supported, but platform might not detect license same way we do + // fallback to our local file logic + if len(licensesFound) == 0 { + break + } for _, v := range licensesFound { results.LicenseFiles = append(results.LicenseFiles, checker.LicenseFile{