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

🧹 improve github org discovery #4590

Merged
merged 1 commit into from
Aug 27, 2024
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
4 changes: 3 additions & 1 deletion providers/github/resources/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func org(runtime *plugin.Runtime, orgName string, conn *connection.GithubConnect
return nil, err
}

if reposFilter.empty() {
// only scan the org if the discover flag is provided, this allows you to scan all repos in an org with simply using
// --discover repos. If users provide a repo filter, we also want to skip org scan.
if stringx.ContainsAnyOf(targets, connection.DiscoveryOrganization, connection.DiscoveryAll, connection.DiscoveryAuto) && reposFilter.empty() {
assetList = append(assetList, &inventory.Asset{
PlatformIds: []string{connection.NewGithubOrgIdentifier(org.Login.Data)},
Name: org.Name.Data,
Expand Down
Loading