Skip to content

Commit

Permalink
add terraform format job
Browse files Browse the repository at this point in the history
  • Loading branch information
davex98 committed Nov 30, 2023
1 parent 89fa800 commit 576de74
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/terraform-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Terraform format
on:
pull_request:
jobs:
terraform_fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Terraform
uses: hashicorp/setup-terraform@v2

- name: Terraform format
run: |
make format-tf
if [[ -n $(git status -s) ]]
then
echo "Terraform code is not formatted, format it by running 'make format-tf' and commit your changes."
exit 1
fi
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ init-examples:
done \
done

.PHONY: format-tf
format-tf:
terraform fmt -recursive -list=false

.PHONY: generate-sdk
generate-sdk:
@echo "==> Generating castai sdk client"
Expand Down

0 comments on commit 576de74

Please sign in to comment.