From 2da31422aa695e279d2479dbbeb5a20db5552954 Mon Sep 17 00:00:00 2001 From: Christopher Kim Date: Tue, 20 Apr 2021 17:45:15 -0700 Subject: [PATCH] Initial terraform-fmt action --- terraform-fmt/action.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 terraform-fmt/action.yml diff --git a/terraform-fmt/action.yml b/terraform-fmt/action.yml new file mode 100644 index 0000000..6b4feac --- /dev/null +++ b/terraform-fmt/action.yml @@ -0,0 +1,20 @@ +name: Terraform Fmt +description: Checks Terraform formatting + +inputs: + working_directory: + required: true + +runs: + using: "composite" + steps: + - name: Check formatting + run: | + if terraform fmt -recursive -check -diff; then + echo 'No formatting issues found' + else + echo + echo 'Formatting issues found, run `terraform fmt` and re-commit' + fi + working-directory: ${{ inputs.working_directory }} + shell: bash