Skip to content

Commit

Permalink
adding hmcts user and ensure the pipeline pushes the changes to the s…
Browse files Browse the repository at this point in the history
…ource branch
  • Loading branch information
ConnorOKane-Kainos committed Aug 10, 2024
1 parent 3f05558 commit 29a547b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
id-token: write
issues: write
pull-requests: write
contents: read
contents: write

jobs:
pre-commit:
Expand Down Expand Up @@ -50,16 +50,24 @@ jobs:
cd components
terraform fmt -recursive
- name: Check for changes
id: git-check
run: |
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit and push if changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --global user.name 'hmcts-platform-operations'
git config --global user.email '[email protected]'
git add .
git commit -m "Apply Terraform formatting changes"
git push
- name: Run Pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --files components/**/*

- name: Auto Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply Terraform formatting changes"
file_pattern: components/**/*

terraform:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 29a547b

Please sign in to comment.