From 44c894c301aec0f0e8539ada124f9342ebc66dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D7=A0=CF=85=CE=B1=CE=B7=20=D7=A0=CF=85=CE=B1=CE=B7=D1=95?= =?UTF-8?q?=CF=83=CE=B7?= Date: Tue, 7 May 2024 18:52:07 -0700 Subject: [PATCH] Add terraform fmt check PR action --- .github/workflows/fmt:check.yml | 23 +++++++++++++++++++++++ Taskfile.yml | 13 +++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/fmt:check.yml create mode 100644 Taskfile.yml diff --git a/.github/workflows/fmt:check.yml b/.github/workflows/fmt:check.yml new file mode 100644 index 0000000..bc4fa62 --- /dev/null +++ b/.github/workflows/fmt:check.yml @@ -0,0 +1,23 @@ +--- +on: + pull_request: + branches: + - main + +jobs: + terraform: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Task + uses: arduino/setup-task@v2 + with: + version: 3.x + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: "1.8.2" + - name: Terraform Format Check + run: task fmt:check diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..1684a3a --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,13 @@ +--- +version: "3" + +tasks: + fmt: + desc: Reformat your configuration in the standard style + cmds: + - terraform fmt -recursive . + + fmt:check: + desc: Check if the input is formatted + cmds: + - terraform fmt -recursive -check -diff .