Skip to content

Commit

Permalink
🐛 fallback to local file detection on empty GitHub license response. (#…
Browse files Browse the repository at this point in the history
…3412)

Signed-off-by: Spencer Schrock <[email protected]>
  • Loading branch information
spencerschrock authored Aug 23, 2023
1 parent eba10df commit f7409b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions checks/raw/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit f7409b3

Please sign in to comment.