Skip to content

Commit e03541c

Browse files
committed
shellcheck_run_steps: Avoid failure when YAML contains no run steps
Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
1 parent bf32bca commit e03541c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pre_commit_hooks/shellcheck_run_steps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def do_shellcheck(
4949
),
5050
),
5151
)
52+
if len(all_steps) == 0:
53+
return
5254
for step, shfile in all_steps:
5355
shfile.write(step["runs"])
5456
shfile.close()

0 commit comments

Comments
 (0)