Skip to content

Commit

Permalink
Check reusable github action yamls
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Aug 14, 2024
1 parent 8df5d64 commit 48e1ccc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions yaml_shellcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ def get_runs(data, path):
return results

result = {}
if "jobs" not in data:
if "jobs" not in data and "runs" not in data:
return result
result = get_runs(data["jobs"], "jobs")

result = get_runs(data["jobs"], "jobs") if "jobs" in data else get_runs(data["runs"], "runs")
logging.debug("got scripts: %s", result)
for key in result:
logging.debug("%s: %s", key, result[key])
Expand Down Expand Up @@ -334,6 +335,9 @@ def select_yaml_schema(documents, filename):
logging.info(f"read {filename} as Bitbucket Pipelines config...")
return get_bitbucket_scripts, 0
elif isinstance(data, dict) and "on" in data and "jobs" in data:
logging.info(f"read {filename} as GitHub Workflows config...")
return get_github_scripts, 0
elif isinstance(data, dict) and "inputs" in data and "runs" in data:
logging.info(f"read {filename} as GitHub Actions config...")
return get_github_scripts, 0
elif isinstance(data, dict) and "version" in data and "jobs" in data:
Expand Down

0 comments on commit 48e1ccc

Please sign in to comment.