From ee733379e314d44f1a960a70339ee5e5d19e404d Mon Sep 17 00:00:00 2001 From: Alexis Rodriguez Date: Mon, 31 Jul 2023 18:09:42 -0400 Subject: [PATCH] Fixes issue #1 related to missing name field in workflow step --- .gitignore | 1 + analyzer/analyzer.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 68bc17f..732c190 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,4 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +.vscode \ No newline at end of file diff --git a/analyzer/analyzer.py b/analyzer/analyzer.py index 888af7d..74a0782 100644 --- a/analyzer/analyzer.py +++ b/analyzer/analyzer.py @@ -77,9 +77,13 @@ def _check_for_inline_script(self) -> bool: for step in steps: if "run" in step: if self.verbose: - print( - f"{Colors.LIGHT_GRAY}INFO{Colors.END} found inline script in job('{job}').step('{step['name']}')" - ) + # NOTE: name is not required according to GitHub Docs: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#name + if 'name' in step: + print( + f"{Colors.LIGHT_GRAY}INFO{Colors.END} found inline script in job('{job}').step('{step['name']}')" + ) + else: + print(f"{Colors.LIGHT_GRAY}INFO{Colors.END} found step with inline script in job('{job}')") passed = False return passed