Fixed: Pass GITHUB_TOKEN to cargo-binstall for higher rate limits#13
Fixed: Pass GITHUB_TOKEN to cargo-binstall for higher rate limits#13
Conversation
When cargo-binstall installs packages from GitHub releases, it queries the GitHub API. Without authentication, this is limited to 60 req/hr, causing 403 Forbidden errors in CI. The fix passes GITHUB_TOKEN via environment variable, which gives: - 1000 req/hr rate limit (vs 60 unauthenticated) - Avoids fallback to cargo install from source
WalkthroughThe action.yml file was updated to set the GITHUB_TOKEN environment variable with the value 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@action.yml`:
- Around line 198-200: The workflow currently uses the mutable ref "uses:
cargo-bins/cargo-binstall@main" and exposes GITHUB_TOKEN, which is a
supply-chain risk; update the "uses" reference to a specific commit SHA (or an
immutable tag) for cargo-bins/cargo-binstall instead of `@main` so the action is
pinned, keeping the "env: GITHUB_TOKEN" usage unchanged but now tied to an
immutable action; locate the line containing "uses:
cargo-bins/cargo-binstall@main" and replace `@main` with the chosen commit SHA.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1-master #13 +/- ##
===============================
===============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Passes
GITHUB_TOKENto cargo-binstall to avoid GitHub API rate limiting.Problem
When cargo-binstall installs packages from GitHub releases, it queries the GitHub API. Without authentication, this is limited to 60 requests/hour, causing
403 Forbiddenerrors in CI environments. This leads to:deadline has elapsedcargo install(compiles from source, adding ~5-10 min per job)Solution
Pass
GITHUB_TOKENvia environment variable to both:cargo-bins/cargo-binstall@mainaction (line 198-199)cargo binstall cargo-tarpaulincommand (line 203-204)This gives:
References