From efca565f11c040621892504e5eb922053395d6b5 Mon Sep 17 00:00:00 2001 From: Kaiyue Jiang Date: Wed, 11 Mar 2026 15:08:51 -0700 Subject: [PATCH] Add retry with backoff for npm install in Bun Compile workflow npm registry propagation can take time after publish, causing the repository_dispatch-triggered workflow to fail when bun tries to install a version that hasn't propagated yet. Adds a retry loop (5 attempts, 30s backoff) to handle this race condition gracefully. --- .github/workflows/bun-compile.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bun-compile.yml b/.github/workflows/bun-compile.yml index d7e8054..36f9c40 100644 --- a/.github/workflows/bun-compile.yml +++ b/.github/workflows/bun-compile.yml @@ -52,7 +52,23 @@ jobs: echo "::error::No version provided. Supply via workflow_dispatch input or repository_dispatch payload." exit 1 fi - bun install "@augmentcode/auggie@${VERSION}" + # Retry with backoff — npm registry may not have propagated the version yet + # when triggered immediately via repository_dispatch on publish. + max_attempts=5 + for attempt in $(seq 1 $max_attempts); do + echo "Attempt $attempt/$max_attempts: installing @augmentcode/auggie@${VERSION}" + if bun install "@augmentcode/auggie@${VERSION}"; then + echo "Successfully installed on attempt $attempt" + exit 0 + fi + if [ "$attempt" -lt "$max_attempts" ]; then + delay=$((attempt * 30)) + echo "Install failed, retrying in ${delay}s..." + sleep "$delay" + fi + done + echo "::error::Failed to install @augmentcode/auggie@${VERSION} after $max_attempts attempts" + exit 1 - name: Create entry point run: |