From 8fe6b508c343da8e7ea40136966fbccbcf128cc8 Mon Sep 17 00:00:00 2001 From: David Milum Date: Mon, 17 May 2021 20:34:01 -0400 Subject: [PATCH] LEFTHOOK_QUIET environment variable with the same function as skip_output --- cmd/run.go | 7 +++++++ docs/full_guide.md | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/cmd/run.go b/cmd/run.go index aa99c815..d4d6b851 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -439,6 +439,13 @@ func isSkipPrintOutput(outputDetailValue string) bool { } } + env := os.Getenv("LEFTHOOK_QUIET") + for _, elem := range strings.Split(env, ",") { + if strings.TrimSpace(elem) == outputDetailValue { + return true + } + } + return false } diff --git a/docs/full_guide.md b/docs/full_guide.md index fd3356f3..3b106ac4 100644 --- a/docs/full_guide.md +++ b/docs/full_guide.md @@ -493,6 +493,12 @@ skip_output: - success - summary ``` + +You can also do this with an environment variable: +```bash +export LEFTHOOK_QUIET="meta,success,summary" +``` + ## CI integration Enable `CI` env variable if it doens't exists on your service by default.