Skip to content

chore: fix retry logic in check-kilo-version workflow#258

Merged
mbabic84 merged 1 commit into
mainfrom
chore/fix-check-version-retry
Jul 17, 2026
Merged

chore: fix retry logic in check-kilo-version workflow#258
mbabic84 merged 1 commit into
mainfrom
chore/fix-check-version-retry

Conversation

@mbabic84

Copy link
Copy Markdown
Owner

Problem

The check-kilo-version workflow has been failing with exit code 22 (curl HTTP error). The retry loop with exponential backoff was structured correctly but never actually retried — the script died on the first failure.

Root Cause

GitHub Actions runs bash with -eo pipefail by default. The original code used a bare assignment:

LATEST=$(curl -sSf ... | jq ... | sed ...)
if [ $? -eq 0 ] && ...

When curl -sSf returned a non-zero exit code, set -e killed the script immediately at the assignment — the $? check was never reached. The CI log confirmed this: exit code 22 (from curl) instead of exit code 1 (from the explicit exit 1).

Fix

  • Wrap assignment in if-condition — this suppresses set -e for the tested command, which is the idiomatic bash pattern for retry loops under errexit
  • Add Authorization: Bearer header — authenticated requests get higher rate limits (5,000/hr vs 60/hr)
  • Add jitter to backoffRANDOM % 5 prevents thundering herd on coinciding scheduled runs

GitHub Actions runs bash with -eo pipefail by default. The bare
LATEST=$(...) assignment triggered set -e on curl failure, killing
the script before the $? check was reached.

Wrap the assignment in an if-condition to suppress errexit, add
authentication header, and add jitter to backoff.
@mbabic84
mbabic84 merged commit 5a1fcfb into main Jul 17, 2026
1 check passed
@mbabic84
mbabic84 deleted the chore/fix-check-version-retry branch July 17, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant