Skip to content

Commit

Permalink
Add terraform fmt check PR action
Browse files Browse the repository at this point in the history
  • Loading branch information
נυαη נυαηѕση committed May 8, 2024
1 parent 9d71aae commit 44c894c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/fmt:check.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -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 .

0 comments on commit 44c894c

Please sign in to comment.