Skip to content

Commit

Permalink
HOTFIX: fix caching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mas0nd committed Apr 16, 2024
1 parent e006b72 commit 894056e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions gato/enumerate/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def construct_workflow_cache(self, yml_results):
graphql and REST do not have parity, we still need to use rest for most
enumeration calls. This method saves off all yml files, so during org
level enumeration if we perform yml enumeration the cached file is used
instead of making github REST requests.
instead of making github REST requests.
Args:
yml_results (list): List of results from individual GraphQL queries
Expand All @@ -189,17 +189,16 @@ def construct_workflow_cache(self, yml_results):
for result in yml_results:
# If we get any malformed/missing data just skip it and
# Gato will fall back to the contents API for these few cases.
if not result:
continue

if 'nameWithOwner' not in result:
if not result or \
'nameWithOwner' not in result or \
'object' not in result or \
not result['object']:
continue

owner = result['nameWithOwner']
# Empty means no yamls, so just skip.
if not result['object']:

if owner not in self.workflow_cache:
self.workflow_cache[owner] = list()
continue

for yml_node in result['object']['entries']:
yml_name = yml_node['name']
Expand Down

0 comments on commit 894056e

Please sign in to comment.