Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fallback to local file detection on empty GitHub license response. #3412

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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