From de604e59ad23af2114aa9dcfe2f53e465e3942fb Mon Sep 17 00:00:00 2001 From: temp20230620 <137216868+temp20230620@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:29:17 -0400 Subject: [PATCH] Make Jinja variable regex lazy --- yaml_shellcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml_shellcheck.py b/yaml_shellcheck.py index f38aaee..f19b638 100755 --- a/yaml_shellcheck.py +++ b/yaml_shellcheck.py @@ -277,7 +277,7 @@ def get_shell_tasks(data, path): # we cannot evaluate Jinja templates # at least try to be useful and replace every expression with a variable # we do not handle Jinja statements like loops of if/then/else - script = re.sub(r"{{.*}}", "$JINJA_EXPRESSION", script) + script = re.sub(r"{{.*?}}", "$JINJA_EXPRESSION", script) # try to add shebang line from 'executable' if it looks like a shell executable = task.get("args", {}).get("executable", None)