feat: Support archived repo exclusion from GH org scans#4875
feat: Support archived repo exclusion from GH org scans#4875hibare wants to merge 1 commit intotrufflesecurity:mainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 64137fa. Configure here.
| continue | ||
| } | ||
| numArchived++ | ||
| } |
There was a problem hiding this comment.
Archived repo counter incremented only when not excluding
Low Severity
The numArchived counter is placed after the continue statement inside the ExcludeArchived check, so it's only incremented when archived repos are included (not excluded). When ExcludeArchived is true, repos are skipped via continue before numArchived++ runs, making the final log line always report num_archived=0 — exactly when you'd most want to know how many were skipped.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 64137fa. Configure here.
There was a problem hiding this comment.
This behaviour is inline with how numForks is counted.


Description:
Adds optional exclusion of archived GitHub repositories from organization scans. Introduces the
--exclude-archivedflag on thegithubsubcommand, a matchingexclude_archivedfield on the GitHub source protobuf (sourcespb.GitHub), and wiring throughGithubConfig, the engine, and org repo enumeration so archived repos are skipped when the option is enabled. Default behavior is unchanged when the flag is not set. Includes unit tests, an integration test case, and README usage.Checklist:
make test-community)?make lintthis requires golangci-lint)?