fix: add timeout and retry for terraform refresh-heavy plans
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 5m22s

This commit is contained in:
2026-02-28 22:23:01 +00:00
parent f5d9eba9d0
commit 24c3f56399
3 changed files with 46 additions and 5 deletions

View File

@@ -53,7 +53,20 @@ jobs:
- name: Terraform Plan
working-directory: terraform
run: terraform plan -out=tfplan
run: |
set -euo pipefail
for attempt in 1 2; do
echo "Terraform plan attempt $attempt/2"
if timeout 20m terraform plan -parallelism=1 -out=tfplan; then
exit 0
fi
if [ "$attempt" -eq 1 ]; then
echo "Plan attempt failed or timed out; retrying in 20s"
sleep 20
fi
done
echo "Terraform plan failed after retries"
exit 1
- name: Block accidental destroy
env: