Skip to content

feat: make the CLI download more tolerant to short GitHub outages - #15

Merged
dcoraboeuf merged 1 commit into
mainfrom
claude/mattpocock-skills-impl-14-253ec3
Oct 2, 2026
Merged

dcoraboeuf merged 1 commit into
mainfrom
claude/mattpocock-skills-impl-14-253ec3

Conversation

@dcoraboeuf

Copy link
Copy Markdown
Contributor

Closes #14

Changes

Download retries

  • New inputs download-retry-count (default 0) and download-retry-wait (default 30 seconds).
  • @actions/tool-cache always makes 3 tries per download and that can't be configured, so each retry is another full round of those 3 tries.
  • 4xx errors fail immediately, except 408 and 429 (the same rule the library uses).
  • Values that aren't non-negative whole numbers are rejected.

Reusing a CLI already on the runner

  • After a download, the CLI is stored in the runner tool cache (tc.cacheFile, under the name ontrack-cli).
  • When the exact requested version is already cached, the download is skipped (tc.find).
  • Partial versions such as 5 don't use the cache, because the library would treat them as a range.
  • Only self-hosted runners benefit, since GitHub-hosted runners start with an empty tool cache. The README explains how to pre-install the CLI in a runner image.
  • The CLI is now added to the PATH from the tool-cache folder instead of RUNNER_TEMP. The binary is still named ontrack-cli.

Testing

  • Unit tests cover retries, giving up after the last retry, failing immediately on a 4xx, reusing the cache, a cache miss, a partial version, and input validation.
  • Ran against the real @actions/tool-cache with a local server returning 504 four times, then 200. The download succeeded on the second round, the cached binary kept its executable permissions, and a second run reused the cache.

Not covered

  • When version is empty, the lookup of the latest release through the GitHub API still has no retry.

🤖 Generated with Claude Code

- New `download-retry-count` and `download-retry-wait` inputs add extra
  download rounds on top of the 3 tries made by @actions/tool-cache.
  Client errors (4xx except 408/429) are not retried. Defaults to no
  extra round, so existing behavior is unchanged.
- The downloaded CLI is stored in the runner tool cache and reused when
  the exact requested version is already there, so self-hosted runners
  (or images with a pre-installed CLI) skip the download.

Closes #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dcoraboeuf
dcoraboeuf merged commit 2e99152 into main Oct 2, 2026
1 check passed
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.

Make the CLI download more tolerant to short GitHub outages

1 participant