Fix close friends max per page #9

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2025-08-23 15:12:53 +02:00
parent 9b914e14ba
commit a17caa6233
+2 -2
View File
@@ -30,7 +30,7 @@ const (
// 3. The candidate follows the target back (+1 point). // 3. The candidate follows the target back (+1 point).
// 4. The candidate shares at least one organization with the target (+1 point). // 4. The candidate shares at least one organization with the target (+1 point).
func CloseFriends(s github_recon_settings.Settings) (results CloseFriendsResult) { func CloseFriends(s github_recon_settings.Settings) (results CloseFriendsResult) {
targetFollowing, resp, err := s.Client.Users.ListFollowing(s.Ctx, s.Target, nil) targetFollowing, resp, err := s.Client.Users.ListFollowing(s.Ctx, s.Target, &github.ListOptions{PerPage: 100})
if err != nil { if err != nil {
s.Logger.Error("Failed to fetch target's following list", "err", err) s.Logger.Error("Failed to fetch target's following list", "err", err)
return return
@@ -43,7 +43,7 @@ func CloseFriends(s github_recon_settings.Settings) (results CloseFriendsResult)
targetOrgs = []*github.Organization{} targetOrgs = []*github.Organization{}
} }
if len(targetFollowing) >= maxTargetFollowing { if len(targetFollowing) > maxTargetFollowing {
s.Logger.Info("Skipping close friends check", s.Logger.Info("Skipping close friends check",
"reason", "reason",
fmt.Sprintf("Target follows %d or more users (limit: %d)", len(targetFollowing), maxTargetFollowing), fmt.Sprintf("Target follows %d or more users (limit: %d)", len(targetFollowing), maxTargetFollowing),