Skip to content

Commit

Permalink
Add new fields for github orgs (#3925)
Browse files Browse the repository at this point in the history
* Add new fields for github orgs

Grab project data for the org and projects

Signed-off-by: Tim Smith <[email protected]>

* 🧹 fix whitespace in github lr file

---------

Signed-off-by: Tim Smith <[email protected]>
Co-authored-by: Christoph Hartmann <[email protected]>
  • Loading branch information
tas50 and chris-rock authored May 5, 2024
1 parent bdc0bc2 commit d06cadb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/github/resources/github.lr
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ github.organization @defaults("login name") {
webhooks() []github.webhook
// List of packages
packages() []github.package
// Whether the organization has projects
hasOrganizationProjects bool
// Whether projects in the organization have projects
hasRepositoryProjects bool
}

// GitHub user
Expand Down
24 changes: 24 additions & 0 deletions providers/github/resources/github.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions providers/github/resources/github.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ resources:
min_mondoo_version: 7.14.0
following:
min_mondoo_version: 7.14.0
hasOrganizationProjects:
min_mondoo_version: 9.0.0
hasRepositoryProjects:
min_mondoo_version: 9.0.0
id: {}
installations:
min_mondoo_version: 5.31.0
Expand Down
3 changes: 3 additions & 0 deletions providers/github/resources/github_org.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func initGithubOrganization(runtime *plugin.Runtime, args map[string]*llx.RawDat
args["twoFactorRequirementEnabled"] = llx.BoolData(convert.ToBool(org.TwoFactorRequirementEnabled))
args["isVerified"] = llx.BoolData(convert.ToBool(org.IsVerified))

args["hasOrganizationProjects"] = llx.BoolData(convert.ToBool(org.HasOrganizationProjects))
args["hasRepositoryProjects"] = llx.BoolData(convert.ToBool(org.HasRepositoryProjects))

args["defaultRepositoryPermission"] = llx.StringDataPtr(org.DefaultRepoPermission)
args["membersCanCreateRepositories"] = llx.BoolData(convert.ToBool(org.MembersCanCreateRepos))
args["membersCanCreatePublicRepositories"] = llx.BoolData(convert.ToBool(org.MembersCanCreatePublicRepos))
Expand Down

0 comments on commit d06cadb

Please sign in to comment.