From 14b0e32bae6f2206b3746a4875e448174ef1ddd3 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 6 Aug 2021 10:08:10 -0400 Subject: [PATCH] Only look for env vars that *start* with BUILDKITE Rather than filtering env vars to pass to buildkite-pyyaml by those that *contain* the string BUILDKITE, filter to variables that *start* with BUILDKITE, using the -0 flag to env and the -z flag to grep to delimit the variables by null characters rather than newlines so we don't also grab lines inside multi-line env vars (such as the commit message) --- hooks/command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/command b/hooks/command index 20600b9..56e5a32 100755 --- a/hooks/command +++ b/hooks/command @@ -45,7 +45,7 @@ fi docker build "$basedir" -t buildkite-pyyaml > /dev/null -docker run --rm -v "$PWD:/buildkite" --env-file <(env | grep BUILDKITE) buildkite-pyyaml +docker run --rm -v "$PWD:/buildkite" --env-file <(env -0 | grep -z '\^BUILDKITE' | tr '\0' '\n') buildkite-pyyaml if [[ -s ".git_diff_conditional/pipeline_output" ]]; then echo "Uploading the pipeline to the buildkite-agent"