@@ -29,26 +29,25 @@ def list_github_apps_in_organization(organization: str):
29
29
print (f'Listing GitHub Apps in { organization } failed' )
30
30
print (response_json )
31
31
# Extract the list of dictionaries
32
- if response_json .get ('installationss' ) is not None :
33
- list_of_installations = response_json ["installations" ]
34
- print (f'Found { len (list_of_installations )} GitHub App in { organization } organization' )
32
+ list_of_installations = response_json ["installations" ]
33
+ print (f'Found { len (list_of_installations )} GitHub App in { organization } organization' )
35
34
36
- # Convert list of dictionaries to JSON string
37
- json_data = json .dumps (list_of_installations , indent = 4 )
35
+ # Convert list of dictionaries to JSON string
36
+ json_data = json .dumps (list_of_installations , indent = 4 )
38
37
39
- # Write JSON string to a file
40
- with open ("list_of_github_installations.json" , "w" ) as file :
41
- file .write (json_data )
38
+ # Write JSON string to a file
39
+ with open ("list_of_github_installations.json" , "w" ) as file :
40
+ file .write (json_data )
42
41
43
- app_short_list = []
44
- for app in list_of_installations :
45
- app_dict = {}
46
- app_dict ['id' ] = app ['id' ]
47
- app_dict ['app_id' ] = app ['app_id' ]
48
- app_dict ['app_slug' ] = app ['app_slug' ]
49
- app_short_list .append (app_dict )
42
+ app_short_list = []
43
+ for app in list_of_installations :
44
+ app_dict = {}
45
+ app_dict ['id' ] = app ['id' ]
46
+ app_dict ['app_id' ] = app ['app_id' ]
47
+ app_dict ['app_slug' ] = app ['app_slug' ]
48
+ app_short_list .append (app_dict )
50
49
51
- return app_short_list
50
+ return app_short_list
52
51
53
52
def main ():
54
53
""" To test the code """
0 commit comments