Skip to content

Commit c405271

Browse files
committed
ci: retry assign-reviewers on transient provider overloads
Add bounded retries with backoff for the Claude /assign-reviewers step so temporary 529 overloaded errors do not fail PR checks. Made-with: Cursor
1 parent 180b36e commit c405271

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/pr-auto-review.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
assign-reviewers:
99
runs-on: ubuntu-latest
10+
timeout-minutes: 15
1011
# Skip bot-authored PRs entirely
1112
if: >
1213
github.actor != 'dependabot[bot]' &&
@@ -32,5 +33,24 @@ jobs:
3233
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3334
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3435
run: |
35-
claude --dangerously-skip-permissions \
36-
-p "Read commands/assign-reviewers.md and execute the full protocol for this PR: ${{ github.event.pull_request.html_url }}"
36+
prompt="Read commands/assign-reviewers.md and execute the full protocol for this PR: ${{ github.event.pull_request.html_url }}"
37+
max_attempts=3
38+
attempt=1
39+
40+
while [ "$attempt" -le "$max_attempts" ]; do
41+
echo "Attempt $attempt/$max_attempts: running assign-reviewers"
42+
if claude --dangerously-skip-permissions -p "$prompt"; then
43+
echo "assign-reviewers completed successfully"
44+
exit 0
45+
fi
46+
47+
if [ "$attempt" -lt "$max_attempts" ]; then
48+
sleep_seconds=$((attempt * 30))
49+
echo "assign-reviewers failed on attempt $attempt; retrying in ${sleep_seconds}s..."
50+
sleep "$sleep_seconds"
51+
fi
52+
attempt=$((attempt + 1))
53+
done
54+
55+
echo "assign-reviewers failed after $max_attempts attempts"
56+
exit 1

0 commit comments

Comments
 (0)