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 .