Browse Source

Checks Run value, alert user if it needs to be a single line (#15)

pull/16/head
Micaiah Martin 4 years ago committed by GitHub
parent
commit
ed0a8b1933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lint-workflow/lint.py

6
lint-workflow/lint.py

@ -86,6 +86,12 @@ def lint(filename): @@ -86,6 +86,12 @@ def lint(filename):
findings.append(
f"- Step {str(i)} of job key '{job_key}' does not have a valid action hash. (missing '@' character)"
)
# If the step has a 'run' key and only has one command, check if it's a single line.
if "run" in step:
if step["run"].count('\n') == 1:
findings.append(
f"- Run in step {str(i)} of job key '{job_key}' should be a single line."
)
if len(findings) > 0:
print("#", filename)

Loading…
Cancel
Save