-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding hmcts user and ensure the pipeline pushes the changes to the s…
…ource branch
- Loading branch information
1 parent
3f05558
commit 29a547b
Showing
1 changed file
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ permissions: | |
id-token: write | ||
issues: write | ||
pull-requests: write | ||
contents: read | ||
contents: write | ||
|
||
jobs: | ||
pre-commit: | ||
|
@@ -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 | ||
|