Skip to content

Commit

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

Signed-off-by: Spencer Schrock <[email protected]>
Signed-off-by: Allen Shearin <[email protected]>
  • Loading branch information
spencerschrock authored and ashearin committed Nov 13, 2023
1 parent 24398b3 commit 80ac716
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 80ac716

Please sign in to comment.