Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More canonical way of checking types #84

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gato/workflow_parser/workflow_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ def self_hosted(self):
# We only need ONE to be self hosted, others can be
# GitHub hosted
for key in os_list:
if type(key) == str:
if type(key) is str:
if key not in self.GITHUB_HOSTED_LABELS and not re.match(self.LARGER_RUNNER_REGEX_LIST, key):
sh_jobs.append((jobname, job_details))
break
pass
else:
if type(runs_on) == list:
if type(runs_on) is list:
for label in runs_on:
if label not in self.GITHUB_HOSTED_LABELS and \
not re.match(self.LARGER_RUNNER_REGEX_LIST, label):
sh_jobs.append((jobname, job_details))
break
elif type(runs_on) == str:
elif type(runs_on) is str:
if runs_on in self.GITHUB_HOSTED_LABELS or \
re.match(self.LARGER_RUNNER_REGEX_LIST, runs_on):
continue
Expand Down