Skip to content

Commit b2a564e

Browse files
mikipaletclaude
andcommitted
ci: harden OpenAPI fetch + push against transient failures
- Add curl retry (5 attempts, 2s delay, 60s timeout) so a transient SSL error on zernio.com/openapi.yaml no longer fails the run. - Wrap `git push` in a pull-rebase-retry loop (3 attempts) so concurrent dispatches that land back-to-back don't race for the same ref. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dca7f0c commit b2a564e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/generate.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Fetch latest OpenAPI spec
3232
run: |
33-
curl -f -o openapi.yaml https://zernio.com/openapi.yaml
33+
curl -f --retry 5 --retry-delay 2 --retry-all-errors --max-time 60 -o openapi.yaml https://zernio.com/openapi.yaml
3434
echo "Fetched OpenAPI spec"
3535
3636
- name: Generate SDK
@@ -88,7 +88,14 @@ jobs:
8888
8989
- Auto-generated SDK updates
9090
- Version: ${{ steps.version.outputs.new_version }}"
91-
git push
91+
# Retry with rebase to survive concurrent dispatches that land
92+
# back-to-back pushes to main.
93+
for attempt in 1 2 3; do
94+
if git push; then break; fi
95+
echo "Push attempt $attempt failed; rebasing and retrying..."
96+
git pull --rebase origin main
97+
sleep $((attempt * 5))
98+
done
9299
93100
- name: Create GitHub Release
94101
if: steps.changes.outputs.has_changes == 'true'

0 commit comments

Comments
 (0)