Spaces:
Running
Running
Commit ·
5ae3e4a
1
Parent(s): 493e469
ci: retry workflow validation dry-runs
Browse filesCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
scripts/validate-workflows.sh
CHANGED
|
@@ -3,6 +3,27 @@ set -euo pipefail
|
|
| 3 |
|
| 4 |
actionlint .github/workflows/*.yml
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|