JerrettDavis Copilot commited on
Commit
5ae3e4a
·
1 Parent(s): 493e469

ci: retry workflow validation dry-runs

Browse files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Files changed (1) hide show
  1. scripts/validate-workflows.sh +24 -3
scripts/validate-workflows.sh CHANGED
@@ -3,6 +3,27 @@ set -euo pipefail
3
 
4
  actionlint .github/workflows/*.yml
5
 
6
- act workflow_dispatch -W .github/workflows/release.yml -e .github/act/dry-run.json -n
7
- act push -W .github/workflows/release.yml -e .github/act/push-feat.json -n
8
- act workflow_dispatch -W .github/workflows/docker.yml -e .github/act/docker-version.json -n
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  actionlint .github/workflows/*.yml
5
 
6
+ run_act() {
7
+ local attempt=1
8
+ local max_attempts=3
9
+ local delay_seconds=5
10
+
11
+ while true; do
12
+ if "$@"; then
13
+ return 0
14
+ fi
15
+
16
+ if (( attempt >= max_attempts )); then
17
+ return 1
18
+ fi
19
+
20
+ echo "act dry-run failed on attempt ${attempt}/${max_attempts}; retrying in ${delay_seconds}s..." >&2
21
+ sleep "${delay_seconds}"
22
+ attempt=$((attempt + 1))
23
+ delay_seconds=$((delay_seconds * 2))
24
+ done
25
+ }
26
+
27
+ run_act act workflow_dispatch -W .github/workflows/release.yml -e .github/act/dry-run.json -n
28
+ run_act act push -W .github/workflows/release.yml -e .github/act/push-feat.json -n
29
+ run_act act workflow_dispatch -W .github/workflows/docker.yml -e .github/act/docker-version.json -n