Terraform validate script (#47) #137
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: pre-commit | |
on: | |
pull_request: | |
branches: | |
- "main" | |
push: | |
branches: | |
- "main" | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "1.7.1" | |
- name: "Setup prerequisites" | |
# yamllint disable rule:line-length | |
run: | | |
curl -s -L https://github.com/terraform-docs/terraform-docs/releases/download/v0.17.0/terraform-docs-v0.17.0-linux-amd64.tar.gz | tar xz -C /usr/local/bin terraform-docs | |
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash | |
# yamllint enable rule:line-length | |
- uses: actions/setup-python@v3 | |
# Run terraform validate script so same script can be used in pre-commit | |
# as in nightly pipeline | |
- name: "Terraform validate" | |
run: "tests/terraform_validate.sh" | |
- uses: pre-commit/[email protected] | |
with: | |
extra_args: "--hook-stage manual --all-files" |