From 3fe945f4d2e9f965f9573ef9e43b7af5aad73bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Ole=20Hu=CC=88bner?= Date: Wed, 5 Feb 2025 20:44:57 +0100 Subject: [PATCH] chore: update gitignore and handle no changes in apply script --- .gitignore | 2 ++ apply.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 0c49583..1dcf0a3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ venv/ .terraform.lock.hcl .terraform auth.yaml +tfplan +plan.log diff --git a/apply.sh b/apply.sh index c6c40bc..876cae8 100755 --- a/apply.sh +++ b/apply.sh @@ -26,6 +26,12 @@ if ! tofu plan -out=tfplan 2>&1 | tee plan.log; then fi fi +# Check if no changes are required +if grep -q "No changes" plan.log; then + echo "✅ No changes detected. Exiting." + exit 0 +fi + #applying a planfile skips confirmations... echo "✅ Plan successful. Ready to apply changes." echo "Do you want to apply these changes? (y/n)"