Skip to content

Commit 0a0f67a

Browse files
fixing github app list scrpit
1 parent 7f85053 commit 0a0f67a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

list_all_github_app_in_org.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ def list_github_apps_in_organization(organization: str):
2727
print(f'Listing GitHub Apps in {organization} organization successful')
2828
else:
2929
print(f'Listing GitHub Apps in {organization} failed')
30-
30+
print(response_json)
3131
# Extract the list of dictionaries
32-
list_of_installations = response_json["installations"]
33-
print(f'Found {len(list_of_installations)} GitHub App in {organization} organization')
34-
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')
35+
else:
36+
exit()
3537
# Convert list of dictionaries to JSON string
3638
json_data = json.dumps(list_of_installations, indent=4)
3739

0 commit comments

Comments
 (0)