Skip to content

fix: reject --include-repos/--exclude-repos with --repo in github scan - #5112

Merged
kashifkhan0771 merged 1 commit into
mainfrom
kashif/ins-153
Jul 7, 2026
Merged

fix: reject --include-repos/--exclude-repos with --repo in github scan#5112
kashifkhan0771 merged 1 commit into
mainfrom
kashif/ins-153

Conversation

@kashifkhan0771

@kashifkhan0771 kashifkhan0771 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Explicit --repo entries bypass org-scan filtering entirely, so combining with --include-repos/--exclude-repos silently ignored patterns instead of erroring. Add validation + doc comments explaining the bypass.

Description:

Explain the purpose of the PR.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Low Risk
Small CLI/config validation and documentation only; no change to GitHub enumeration or scanning behavior when flags are used correctly.

Overview
GitHub scans now fail fast when --repo is used together with --include-repos or --exclude-repos, instead of accepting a config where those filters are silently ignored.

Those include/exclude flags only apply to repositories discovered from an org/user scan; explicit --repo URLs skip that filtering path. The CLI returns a clear invalid config error, and GithubConfig comments document that IncludeRepos / ExcludeRepos have no effect when Repos is set explicitly.

Reviewed by Cursor Bugbot for commit 550e3f1. Bugbot is set up for automated code reviews on this repo. Configure here.

Explicit --repo entries bypass org-scan filtering entirely, so combining with --include-repos/--exclude-repos silently ignored patterns instead of erroring.
Add validation + doc comments explaining the bypass.
@kashifkhan0771
kashifkhan0771 requested a review from a team July 7, 2026 07:14
@kashifkhan0771
kashifkhan0771 requested a review from a team as a code owner July 7, 2026 07:14
@kashifkhan0771
kashifkhan0771 merged commit 1675e17 into main Jul 7, 2026
16 checks passed
@kashifkhan0771
kashifkhan0771 deleted the kashif/ins-153 branch July 7, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants