fix: align VM boot disk and add Terraform safety workflows #21

Merged
micqdf merged 4 commits from stage into master 2026-02-28 01:27:00 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit a7f68c0c4b - Show all commits

View File

@@ -59,7 +59,7 @@ jobs:
working-directory: terraform working-directory: terraform
run: | run: |
terraform show -json -no-color tfplan > tfplan.json terraform show -json -no-color tfplan > tfplan.json
DESTROY_COUNT=$(python3 -c 'import json,sys; raw=open("tfplan.json","rb").read().decode("utf-8","ignore"); start=raw.find("{"); end=raw.rfind("}"); data=json.loads(raw[start:end+1]); print(sum(1 for rc in data.get("resource_changes", []) if "delete" in rc.get("change", {}).get("actions", [])))') DESTROY_COUNT=$(python3 -c 'import json; raw=open("tfplan.json","rb").read().decode("utf-8","ignore"); start=raw.find("{"); data=json.JSONDecoder().raw_decode(raw[start:])[0]; print(sum(1 for rc in data.get("resource_changes", []) if "delete" in rc.get("change", {}).get("actions", [])))')
echo "Planned deletes: $DESTROY_COUNT" echo "Planned deletes: $DESTROY_COUNT"
if [ "$DESTROY_COUNT" -gt 0 ] && [ "${ALLOW_TF_DESTROY}" != "true" ]; then if [ "$DESTROY_COUNT" -gt 0 ] && [ "${ALLOW_TF_DESTROY}" != "true" ]; then
echo "Destroy actions detected. Set ALLOW_TF_DESTROY=true to allow." echo "Destroy actions detected. Set ALLOW_TF_DESTROY=true to allow."

View File

@@ -73,7 +73,7 @@ jobs:
working-directory: terraform working-directory: terraform
run: | run: |
terraform show -json -no-color tfplan > tfplan.json terraform show -json -no-color tfplan > tfplan.json
DESTROY_COUNT=$(python3 -c 'import json,sys; raw=open("tfplan.json","rb").read().decode("utf-8","ignore"); start=raw.find("{"); end=raw.rfind("}"); data=json.loads(raw[start:end+1]); print(sum(1 for rc in data.get("resource_changes", []) if "delete" in rc.get("change", {}).get("actions", [])))') DESTROY_COUNT=$(python3 -c 'import json; raw=open("tfplan.json","rb").read().decode("utf-8","ignore"); start=raw.find("{"); data=json.JSONDecoder().raw_decode(raw[start:])[0]; print(sum(1 for rc in data.get("resource_changes", []) if "delete" in rc.get("change", {}).get("actions", [])))')
echo "Planned deletes: $DESTROY_COUNT" echo "Planned deletes: $DESTROY_COUNT"
if [ "$DESTROY_COUNT" -gt 0 ] && [ "${ALLOW_TF_DESTROY}" != "true" ]; then if [ "$DESTROY_COUNT" -gt 0 ] && [ "${ALLOW_TF_DESTROY}" != "true" ]; then
echo "Destroy actions detected. Set ALLOW_TF_DESTROY=true to allow." echo "Destroy actions detected. Set ALLOW_TF_DESTROY=true to allow."