diff --git a/README.md b/README.md index bc5e606..32f1bd5 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ hooks: assume_role: "arn:aws:iam::123456789012:role/LambdaRunner" function_name: "my-${USER}-lambda" region: "us-east-1" - payload: "{}" + payload: "{\"some\": \"$$ will be dollar sign while $@ or ${PATH} will get replaced from the runtime\"}" ``` ## Makefile diff --git a/internal/hooks/hook.go b/internal/hooks/hook.go index 6355049..52b3c15 100644 --- a/internal/hooks/hook.go +++ b/internal/hooks/hook.go @@ -118,5 +118,7 @@ func (h *Hook) Definition() Spec { func templateString(path, template string) string { template = strings.ReplaceAll(template, "{path}", path) - return os.ExpandEnv(template) + template = strings.ReplaceAll(template, "$$", "$&&") + template = os.ExpandEnv(template) + return strings.ReplaceAll(template, "$&&", "$") }