Skip to content

Commit

Permalink
validate that the sate updates with every apply
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-dull committed Oct 4, 2024
1 parent edb8be5 commit 1862fa6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ jobs:
echo ${TF_CONTENT} != ${FILE_CONTENT} >&2
exit 1
fi
- name: Validate terraform state changed
run: |
CURRENT_NULL_RESOURCE_ID=$(echo '${{env.TF_STATE}}' | jq -r '.resources[] | select(.type == "null_resource") | .instances[].attributes.id')
terraform apply --auto-approve
NEW_NULL_RESOURCE_ID=$(curl -sS http://localhost:2442/?env=InT | jq -r '.resources[] | select(.type == "null_resource") | .instances[].attributes.id')
[ "${CURRENT_NULL_RESOURCE_ID}" -ne "${NEW_NULL_RESOURCE_ID}" ]
- name: Clean Up
# Hopefully this is being nice to GHA infra and not wasted CPU cycles
Expand Down

0 comments on commit 1862fa6

Please sign in to comment.