Skip to content

Commit

Permalink
modified: .github/workflows/terraform.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
obervinov committed Jan 3, 2024
1 parent 6f047ec commit 3d3f7cd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ jobs:
run: echo "::set-output name=DOCS_DIRECTORIES::${{ github.event.inputs.DOCS_DIRECTORIES }}"

- name: Terraform format code
run: |
terraform fmt -recursive
- name: Check for Terraform formatting changes
id: terraform-fmt-check
run: |
fmt_changes=$(git diff --name-only --exit-code || echo "changes")
fmt_changes=$(terraform fmt -check -recursive)
[ -n "$fmt_changes" ] && fmt_changes=true || fmt_changes=false
echo "::set-output name=fmt_changes::$fmt_changes"
terraform fmt -recursive
- name: Commit changes
if: steps.terraform-fmt-check.outputs.fmt_changes == 'changes'
if: steps.terraform-fmt-check.outputs.fmt_changes == 'true'
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
Expand Down

0 comments on commit 3d3f7cd

Please sign in to comment.