diff --git a/action.yml b/action.yml index 5eef415..74e515f 100644 --- a/action.yml +++ b/action.yml @@ -29,8 +29,10 @@ inputs: description: 'Additional reviewdog flags' default: '' ### Variables for terraform validate ### + terraform_init_options: + description: 'options for terraform init to pass backend configuration and so on' envvar: - description: 'Environment variables for terraform init' + description: 'Environment variables for terraform init to pass backend configuration' terraform_version: description: 'The terraform version to install and use. The default is `latest`' runs: diff --git a/entrypoint.sh b/entrypoint.sh index 58fb2eb..3f3198a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,7 +11,9 @@ echo "${INPUT_ENVVAR}" | while IFS= read -r line; do export line done -terraform init +printenv + +terraform init ${INPUT_TERRAFORM_INIT_OPTIONS} terraform validate -json \ | jq -r '.diagnostics[] | "\(.range.filename):\(.range.start.line):\(.range.start.column): \(.detail)"' \ | reviewdog -efm="%f:%l:%c:%m" \ diff --git a/testdata/.gitignore b/testdata/.gitignore deleted file mode 100644 index c035e72..0000000 --- a/testdata/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.terraform -.terraform.lock.hcl