Skip to content

Commit

Permalink
Add more properties to github.organization and github.repository (#1865)
Browse files Browse the repository at this point in the history
Use new things in the updated library

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Sep 29, 2023
1 parent 1f16595 commit 6d76369
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
6 changes: 6 additions & 0 deletions providers/github/resources/github.lr
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ github.organization @defaults("login name") {
membersCanCreatePublicPages bool
// Whether members can create private pages
membersCanCreatePrivatePages bool
// Whether members can create private repositories
membersCanForkPrivateRepos bool
// List of users that are part of the owners group
owners() []github.user
// List of users that are part of the members group
Expand Down Expand Up @@ -283,6 +285,10 @@ private github.repository @defaults("fullName") {
hasPages bool
// Whether the repository has downloads
hasDownloads bool
// Whether the repository has discussions
hasDiscussions bool
// Whether the repository is an organization repository template
isTemplate bool
// Whether the repository has open merge requests
openMergeRequests() []github.mergeRequest
// List of branches for the repository
Expand Down
36 changes: 36 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.

6 changes: 6 additions & 0 deletions providers/github/resources/github.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ resources:
min_mondoo_version: 6.11.0
membersCanCreateRepositories:
min_mondoo_version: 6.11.0
membersCanForkPrivateRepos:
min_mondoo_version: 9.0.0
name: {}
node_id: {}
nodeId:
Expand Down Expand Up @@ -325,6 +327,8 @@ resources:
forksCount:
min_mondoo_version: 7.14.0
fullName: {}
hasDiscussions:
min_mondoo_version: 9.0.0
hasDownloads:
min_mondoo_version: 7.14.0
hasIssues:
Expand All @@ -339,6 +343,8 @@ resources:
id: {}
isFork:
min_mondoo_version: 7.14.0
isTemplate:
min_mondoo_version: 9.0.0
language:
min_mondoo_version: 7.14.0
license:
Expand Down
1 change: 1 addition & 0 deletions providers/github/resources/github_org.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func initGithubOrganization(runtime *plugin.Runtime, args map[string]*llx.RawDat
args["membersCanCreatePages"] = llx.BoolData(convert.ToBool(org.MembersCanCreatePages))
args["membersCanCreatePublicPages"] = llx.BoolData(convert.ToBool(org.MembersCanCreatePublicPages))
args["membersCanCreatePrivatePages"] = llx.BoolData(convert.ToBool(org.MembersCanCreatePrivateRepos))
args["membersCanForkPrivateRepos"] = llx.BoolData(convert.ToBool(org.MembersCanForkPrivateRepos))

return args, nil, nil
}
Expand Down
4 changes: 4 additions & 0 deletions providers/github/resources/github_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func newMqlGithubRepository(runtime *plugin.Runtime, repo *github.Repository) (*
"hasWiki": llx.BoolData(repo.GetHasWiki()),
"hasPages": llx.BoolData(repo.GetHasPages()),
"hasDownloads": llx.BoolData(repo.GetHasDownloads()),
"hasDiscussions": llx.BoolData(repo.GetHasDiscussions()),
"isTemplate": llx.BoolData(repo.GetIsTemplate()),
"defaultBranchName": llx.StringDataPtr(repo.DefaultBranch),
"cloneUrl": llx.StringData(repo.GetCloneURL()),
"sshUrl": llx.StringData(repo.GetSSHURL()),
Expand Down Expand Up @@ -206,6 +208,8 @@ func initGithubRepository(runtime *plugin.Runtime, args map[string]*llx.RawData)
args["hasWiki"] = llx.BoolData(repo.GetHasWiki())
args["hasPages"] = llx.BoolData(repo.GetHasPages())
args["hasDownloads"] = llx.BoolData(repo.GetHasDownloads())
args["hasDiscussions"] = llx.BoolData(repo.GetHasDiscussions())
args["isTemplate"] = llx.BoolData(repo.GetIsTemplate())
args["defaultBranchName"] = llx.StringDataPtr(repo.DefaultBranch)
args["cloneUrl"] = llx.StringData(repo.GetCloneURL())
args["sshUrl"] = llx.StringData(repo.GetSSHURL())
Expand Down

0 comments on commit 6d76369

Please sign in to comment.