1414
1515//go:build !no_github
1616
17- //go:generate go run github.com/abc-inc/heimdall/cmd /cmddoc github.com/google/go-github/v69@v69.2.0/github/repos\*.go ../../docs
17+ //go:generate go run github.com/abc-inc/heimdall/tools /cmddoc github.com/google/go-github/v69@v69.2.0/github/repos\*.go ../../docs
1818
1919package github
2020
@@ -31,9 +31,11 @@ import (
3131func NewRepoCmd () * cobra.Command {
3232 var branch string
3333 var protected bool
34+ var subjectDigest string
3435 cfg := newGHCfg ()
3536 cfg .branch = & branch
3637 cfg .protected = & protected
38+ cfg .subjectDigest = & subjectDigest
3739 cfg .visibility = "all"
3840 cfg .affiliation = "owner,collaborator,organization_member"
3941
@@ -51,13 +53,17 @@ func NewRepoCmd() *cobra.Command {
5153 "actions-permissions" ,
5254 "admin-enforcement" ,
5355 "all" ,
56+ "all-custom-property-values" ,
5457 "all-topics" ,
5558 "archive-link" ,
59+ "attestations" ,
5660 "automated-security-fixes" ,
5761 "branch" ,
5862 "branch-protection" ,
5963 "branches" ,
6064 "branches-head-commit" ,
65+ "by-authenticated-user" ,
66+ "by-user" ,
6167 "collaborators" ,
6268 "combined-status" ,
6369 "comment" ,
@@ -72,6 +78,7 @@ func NewRepoCmd() *cobra.Command {
7278 "contents" ,
7379 "contributors" ,
7480 "contributors-stats" ,
81+ "default-workflow-permissions" ,
7582 "download-contents" ,
7683 "download-contents-with-meta" ,
7784 "environment" ,
@@ -121,6 +128,8 @@ func NewRepoCmd() *cobra.Command {
121128 case "archive-link" :
122129 addItemFlags (cfg , sub )
123130 sub .Flags ().StringVar (cfg .branch , "branch" , * cfg .branch , "Branch name" )
131+ case "attestations" :
132+ sub .Flags ().StringVar (cfg .subjectDigest , "subject-digest" , * cfg .subjectDigest , "The digest of the subject to get attestations for" )
124133 case "branch" :
125134 sub .Flags ().StringVar (cfg .branch , "branch" , * cfg .branch , "Branch name" )
126135 case "branch-protection" :
@@ -129,6 +138,17 @@ func NewRepoCmd() *cobra.Command {
129138 sub .Flags ().StringVar (cfg .branch , "branch" , * cfg .branch , "Branch name" )
130139 case "branches" :
131140 sub .Flags ().BoolVar (cfg .protected , "protected" , * cfg .protected , "Whether to return protected, unprotected, or all branches" )
141+ case "by-authenticated-user" :
142+ sub .Flags ().StringVar (& cfg .visibility , "visibility" , "all" , "Visibility (all, public, private)" )
143+ sub .Flags ().StringVar (& cfg .affiliation , "affiliation" , "owner,collaborator,organization_member" , "Comma-separated list of (owner, collaborator, organization_member)" )
144+ sub .Flags ().StringVar (& cfg .typ , "type" , "all" , "Types of repositories you want returned (all, owner, public, private, member)" )
145+ sub .Flags ().StringVar (cfg .sort , "sort" , "full_name" , "The property to sort the results by (created, updated, pushed, full_name)" )
146+ sub .Flags ().StringVar (cfg .direction , "direction" , * cfg .direction , `The order to sort by (default "asc" when using full_name, otherwise "desc")` )
147+ case "by-user" :
148+ sub .Flags ().StringVar (& cfg .user , "username" , cfg .user , "Handle for the GitHub user account." )
149+ sub .Flags ().StringVar (& cfg .typ , "type" , "all" , "Types of repositories you want returned (all, owner, member)" )
150+ sub .Flags ().StringVar (cfg .sort , "sort" , "full_name" , "The property to sort the results by (created, updated, pushed, full_name)" )
151+ sub .Flags ().StringVar (cfg .direction , "direction" , * cfg .direction , `The order to sort by (default "asc" when using full_name, otherwise "desc")` )
132152 case "combined-status" :
133153 sub .Flags ().StringVar (& cfg .ref , "ref" , cfg .ref , "Commit reference" )
134154 case "comment" :
@@ -216,11 +236,16 @@ func execRepos(cfg *ghCfg, cmd *cobra.Command) (x any, err error) {
216236 x , _ , err = svc .GetAdminEnforcement (getCtx (cfg ), cfg .owner , cfg .repo , * cfg .branch )
217237 case "all" :
218238 x , _ , err = svc .ListAll (getCtx (cfg ), & github.RepositoryListAllOptions {Since : cfg .sinceID })
239+ case "all-custom-property-values" :
240+ x , _ , err = svc .GetAllCustomPropertyValues (getCtx (cfg ), cfg .owner , cfg .repo )
219241 case "all-topics" :
220242 x , _ , err = svc .ListAllTopics (getCtx (cfg ), cfg .owner , cfg .repo )
221243 case "archive-link" :
222244 x , _ , err = svc .GetArchiveLink (getCtx (cfg ), cfg .owner , cfg .repo , github .Tarball ,
223245 & github.RepositoryContentGetOptions {Ref : * cfg .branch }, int (cfg .id ))
246+ case "attestations" :
247+ x , _ , err = svc .ListAttestations (getCtx (cfg ), cfg .owner , cfg .repo , * cfg .subjectDigest ,
248+ & github.ListOptions {Page : cfg .page , PerPage : cfg .perPage })
224249 case "automated-security-fixes" :
225250 x , _ , err = svc .GetAutomatedSecurityFixes (getCtx (cfg ), cfg .owner , cfg .repo )
226251 case "branch" :
@@ -233,6 +258,22 @@ func execRepos(cfg *ghCfg, cmd *cobra.Command) (x any, err error) {
233258 x , _ , err = svc .ListBranches (getCtx (cfg ), cfg .owner , cfg .repo , & github.BranchListOptions {
234259 Protected : cfg .protected , ListOptions : github.ListOptions {Page : cfg .page , PerPage : cfg .perPage },
235260 })
261+ case "by-authenticated-user" :
262+ x , _ , err = svc .ListByAuthenticatedUser (getCtx (cfg ), & github.RepositoryListByAuthenticatedUserOptions {
263+ Visibility : cfg .visibility ,
264+ Affiliation : cfg .affiliation ,
265+ Type : cfg .typ ,
266+ Sort : * cfg .sort ,
267+ Direction : * cfg .direction ,
268+ ListOptions : github.ListOptions {Page : cfg .page , PerPage : cfg .perPage },
269+ })
270+ case "by-user" :
271+ x , _ , err = svc .ListByUser (getCtx (cfg ), cfg .user , & github.RepositoryListByUserOptions {
272+ Type : cfg .typ ,
273+ Sort : * cfg .sort ,
274+ Direction : * cfg .direction ,
275+ ListOptions : github.ListOptions {Page : cfg .page , PerPage : cfg .perPage },
276+ })
236277 case "collaborators" :
237278 x , _ , err = svc .ListCollaborators (getCtx (cfg ), cfg .owner , cfg .repo , & github.ListCollaboratorsOptions {
238279 Affiliation : "" ,
@@ -281,6 +322,8 @@ func execRepos(cfg *ghCfg, cmd *cobra.Command) (x any, err error) {
281322 })
282323 case "contributors-stats" :
283324 x , _ , err = svc .ListContributorsStats (getCtx (cfg ), cfg .owner , cfg .repo )
325+ case "default-workflow-permissions" :
326+ x , _ , err = svc .GetDefaultWorkflowPermissions (getCtx (cfg ), cfg .owner , cfg .repo )
284327 case "download-contents" :
285328 x , _ , err = svc .DownloadContents (getCtx (cfg ), cfg .owner , cfg .repo , cfg .path , & github.RepositoryContentGetOptions {Ref : cfg .ref })
286329 case "download-contents-with-meta" :
0 commit comments