Skip to content

Commit

Permalink
chore: ensure that there are no modified files after terraform init
Browse files Browse the repository at this point in the history
Trying to address the following case:
%
Terraform has made some changes to the provider dependency selections recorded
in the .terraform.lock.hcl file. Review those changes and commit them to your
version control system if they represent changes you intended to make.
%
  • Loading branch information
php-coder committed Dec 11, 2024
1 parent 011a94e commit 0c18194
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/provision-by-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ jobs:
TF_IN_AUTOMATION: true
run: terraform init

- name: Check whether there are no modified files
run: >-
MODIFIED_FILES="$(git status --short)";
if [ -n "$MODIFIED_FILES" ]; then
echo >&2 "ERROR: the following files have been modified:";
echo >&2 "$MODIFIED_FILES";
exit 1;
fi
- name: Run terraform plan
working-directory: infra/terraform
env:
Expand Down

0 comments on commit 0c18194

Please sign in to comment.