Skip to content

fix(install): find the latest release without the rate-limited GitHub API - #603

Merged
linroid merged 1 commit into
mainfrom
fix/install-latest-version
Oct 19, 2026
Merged

linroid merged 1 commit into
mainfrom
fix/install-latest-version

Conversation

@linroid

@linroid linroid commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • install.sh asked api.github.com for the latest release. GitHub allows 60 anonymous API requests an hour per IP, so on a shared or busy network the installer failed with curl: (56) ... 403 and "Failed to determine the latest release version."
  • The script now reads the tag from the redirect of https://github.com/linroid/Ketch/releases/latest, which is not under that limit. If that fails, it falls back to the API, sending GITHUB_TOKEN when it is set.
  • The "Fetching latest release..." line now goes to stderr. Before, version="$(resolve_version)" captured it along with the version.
  • The error message now mentions KETCH_VERSION.

Testing

  • Ran resolve_version on its own while the API answered 403 (x-ratelimit-remaining: 0). It returned 0.10.0.
  • ketch-cli-0.10.0-macos-arm64.tar.gz answers 200 at the release download URL the script builds.
  • bash -n install.sh passes.

… API

The installer asked api.github.com for the latest release, which allows 60 anonymous requests an hour per IP, so it failed with a 403 on shared or busy networks. Read the tag from the github.com releases/latest redirect instead, falling back to the API (with GITHUB_TOKEN when set). The progress line now goes to stderr, so it is no longer captured into the version.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T05:46:36.401863Z 94e076b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 19, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@linroid
linroid merged commit 566ee07 into main Oct 19, 2026
12 checks passed
@linroid
linroid deleted the fix/install-latest-version branch October 19, 2026 05:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94e076b32d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install.sh
if [ -z "$tag" ]; then
local auth=()
if [ -n "${GITHUB_TOKEN:-}" ]; then
auth=(-H "Authorization: Bearer ${GITHUB_TOKEN}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the token out of curl's process arguments

When GITHUB_TOKEN is set and the redirect lookup falls back to the API, this places the bearer credential directly in curl's argv, where another local user can read it from the process list while the request is running. Curl's security guidance explicitly warns that command-line options are visible through tools such as ps and recommends supplying secrets through -K or stdin instead; pass this header through stdin or a protected temporary file rather than an argument. curl security considerations

Useful? React with 👍 / 👎.

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