Skip to content

Commit 0c18194

Browse files
committed
chore: ensure that there are no modified files after terraform init
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. %
1 parent 011a94e commit 0c18194

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/provision-by-terraform.yml

+9
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ jobs:
105105
TF_IN_AUTOMATION: true
106106
run: terraform init
107107

108+
- name: Check whether there are no modified files
109+
run: >-
110+
MODIFIED_FILES="$(git status --short)";
111+
if [ -n "$MODIFIED_FILES" ]; then
112+
echo >&2 "ERROR: the following files have been modified:";
113+
echo >&2 "$MODIFIED_FILES";
114+
exit 1;
115+
fi
116+
108117
- name: Run terraform plan
109118
working-directory: infra/terraform
110119
env:

0 commit comments

Comments
 (0)