diff --git a/.github/workflows/tf-commenter.yml b/.github/workflows/tf-commenter.yml new file mode 100644 index 0000000..39e265b --- /dev/null +++ b/.github/workflows/tf-commenter.yml @@ -0,0 +1,20 @@ +name: Post comments about TF syntax + +on: pull_request + +jobs: + post-format-comment: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.6.6 + - name: Terraform Format + run: terraform fmt -recursive + - name: Suggest format changes + uses: reviewdog/action-suggester@v1 + with: + tool_name: terraform fmt + level: error diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 32e10f3..d4d3630 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -23,6 +23,7 @@ jobs: - uses: hashicorp/setup-terraform@v3 with: terraform_version: ${{ matrix.terraform_version }} + - run: terraform fmt -diff -check -recursive - run: terraform init - run: terraform validate