File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,12 @@ def __init__(
75
75
self .enterprise = enterprise or GitHub .enterprise
76
76
self .rest = RestRequest (GitHub .repository )
77
77
78
- def getOrganizations (self ) -> List [Organization ]:
78
+ def getOrganizations (self , include_github : bool = False ) -> List [Organization ]:
79
79
"""Get all the Organizations in an enterprise.
80
80
81
81
You will need to be authenticated as an enterprise owner to use this API.
82
82
"""
83
+ github_orgs = ["github" , "actions" ]
83
84
organizations = []
84
85
url = Octokit .route ("/organizations" , GitHub .repository )
85
86
# pagination uses a different API versus the rest of the API
@@ -102,6 +103,8 @@ def getOrganizations(self) -> List[Organization]:
102
103
return []
103
104
104
105
for org in result :
106
+ if not include_github and org .get ("login" ) in github_orgs :
107
+ continue
105
108
organizations .append (Organization (org .get ("login" ), org .get ("id" )))
106
109
107
110
if len (result ) < 100 :
You can’t perform that action at this time.
0 commit comments