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
322322
323323You can specify environment variables that will be passed to the hook at runtime.
324324
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+
325330Config example :
326331
327332` ` ` yaml
328333- id: terraform_validate
329334 args:
330335 - --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"
333337` ` `
334338
335339# ## 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 {
527527 for var in " ${env_vars[@]} " ; do
528528 var_name=" ${var%% =* } "
529529 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
530535 # shellcheck disable=SC2086
531536 export $var_name =" $var_value "
532537 done
You can’t perform that action at this time.
0 commit comments