Skip to content

Commit

Permalink
Make sure jobs key exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdnaneKhan committed Jul 27, 2023
1 parent ab58bd7 commit 0f54e0b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gato/workflow_parser/workflow_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def output(self, dirpath: str):
dirpath, f'{self.repo_name}/{self.wf_name}'), 'w') as wf_out:
wf_out.write(self.raw_yaml)
return True

def get_secrets(self):
"""_summary_
"""

def self_hosted(self):
"""Analyze if any jobs within the workflow utilize self-hosted runners.
Expand All @@ -76,8 +80,10 @@ def self_hosted(self):
list: List of jobs within the workflow that utilize self-hosted
runners.
"""

sh_jobs = []
if 'jobs' not in self.parsed_yml:
return sh_jobs

for jobname, job_details in self.parsed_yml['jobs'].items():
if 'runs-on' in job_details:
runs_on = job_details['runs-on']
Expand Down

0 comments on commit 0f54e0b

Please sign in to comment.