Skip to content

fix: use authenticated GitHub API requests to avoid rate limiting - #32

Merged
runlevel5 merged 2 commits into
mainfrom
fix/github-api-rate-limit
Mar 19, 2026
Merged

fix: use authenticated GitHub API requests to avoid rate limiting#32
runlevel5 merged 2 commits into
mainfrom
fix/github-api-rate-limit

Conversation

@runlevel5

Copy link
Copy Markdown

Summary

  • Add github-token input to the action for authenticated GitHub API requests
  • Falls back to GITHUB_TOKEN env var (automatically available in GitHub Actions)
  • Passes auth token to both the release API checksum fetch and the binary download

Problem

The install() step makes unauthenticated requests to api.github.com to fetch release checksums for the ejsonkms binary. Unauthenticated requests are limited to 60 req/hr per IP. Since GitHub Actions runners share IPs, this limit is hit frequently, causing HttpClientError: API rate limit exceeded failures.

Solution

Use the GitHub token (from the new github-token input or GITHUB_TOKEN env var) to make authenticated requests, which have a 5,000 req/hr rate limit.

Backwards compatible - the new input is optional, and the action falls back to process.env.GITHUB_TOKEN which is already present in GitHub Actions runners.

The install step fetches release checksums from the GitHub API using
unauthenticated requests, which are limited to 60 req/hr per IP.
Since GitHub Actions runners share IPs, this limit is frequently hit.

Add a github-token input and fall back to GITHUB_TOKEN env var to make
authenticated requests (5,000 req/hr), preventing rate limit errors.
@changeset-bot

changeset-bot Bot commented Mar 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5234f13

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ejsonkms-action Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@runlevel5 runlevel5 closed this Mar 19, 2026
@runlevel5 runlevel5 reopened this Mar 19, 2026
Updated to use authenticated GitHub API requests to prevent rate limiting issues.
@runlevel5
runlevel5 merged commit 9727dfc into main Mar 19, 2026
2 checks passed
@runlevel5
runlevel5 deleted the fix/github-api-rate-limit branch March 19, 2026 02:49
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.

3 participants