Skip to content

Commit

Permalink
Merge pull request #70 from praetorian-inc/hotfix/ignore_broken_yml
Browse files Browse the repository at this point in the history
Hotfix: ignore invalid ymls
  • Loading branch information
jstawinski authored Apr 18, 2024
2 parents 1218ec5 + d1e31e8 commit fffb8b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gato/enumerate/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def __perform_yml_enumeration(self, repository: Repository):
for (wf, yml) in ymls:
try:
parsed_yml = WorkflowParser(yml, repository.name, wf)
if not parsed_yml:
continue
self_hosted_jobs = parsed_yml.self_hosted()

if self_hosted_jobs:
Expand Down
2 changes: 1 addition & 1 deletion gato/workflow_parser/workflow_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def self_hosted(self):
runners.
"""
sh_jobs = []
if 'jobs' not in self.parsed_yml:
if not self.parsed_yml or 'jobs' not in self.parsed_yml:
return sh_jobs

for jobname, job_details in self.parsed_yml['jobs'].items():
Expand Down

0 comments on commit fffb8b5

Please sign in to comment.