fix: add timeout and retry for terraform refresh-heavy plans
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 5m22s
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 5m22s
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user