File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -322,14 +322,18 @@ If for config above set up `export CONFIG_NAME=.tflint; export CONFIG_EXT=hcl` b
322
322
323
323
You can specify environment variables that will be passed to the hook at runtime.
324
324
325
+ > [!IMPORTANT]
326
+ > Variable values are exported _verbatim_:
327
+ > - No interpolation or expansion are applied
328
+ > - The enclosing double quotes are removed if they are provided
329
+
325
330
Config example :
326
331
327
332
` ` ` yaml
328
333
- id: terraform_validate
329
334
args:
330
335
- --env-vars=AWS_DEFAULT_REGION="us-west-2"
331
- - --env-vars=AWS_ACCESS_KEY_ID="anaccesskey"
332
- - --env-vars=AWS_SECRET_ACCESS_KEY="asecretkey"
336
+ - --env-vars=AWS_PROFILE="my-aws-cli-profile"
333
337
` ` `
334
338
335
339
# ## All hooks: Disable color output
Original file line number Diff line number Diff line change @@ -527,6 +527,11 @@ function common::export_provided_env_vars {
527
527
for var in " ${env_vars[@]} " ; do
528
528
var_name=" ${var%% =* } "
529
529
var_value=" ${var#* =} "
530
+ # Drop enclosing double quotes
531
+ if [[ $var_value =~ ^\" && $var_value =~ \" $ ]]; then
532
+ var_value=" ${var_value# \" } "
533
+ var_value=" ${var_value% \" } "
534
+ fi
530
535
# shellcheck disable=SC2086
531
536
export $var_name =" $var_value "
532
537
done
You can’t perform that action at this time.
0 commit comments