Skip to content

Commit

Permalink
Update terraform-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arnold authored and GitHub committed Mar 22, 2025
1 parent fc048ac commit 32dae61
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/terraform-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,23 @@ jobs:
terraform_version: "~>1.6.0"
terraform_wrapper: false

- name: Terraform Format
- name: Format Terraform files
run: terraform fmt -recursive
id: fmt
run: terraform fmt -check
continue-on-error: false

- name: Check for file changes
id: check_changes
run: |
git diff --exit-code || echo "changes_detected=true" >> $GITHUB_ENV
- name: Commit and push changes
if: env.changes_detected == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "chore: format terraform files"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
- name: Terraform Init
id: init
Expand Down

0 comments on commit 32dae61

Please sign in to comment.