fix: replace GitHub API with npm registry for version resolution#5
Merged
fix: replace GitHub API with npm registry for version resolution#5
Conversation
|
✅ Staging deployment successful! Preview: https://vp-setup-staging.void.app/ |
The GitHub API was hitting 403 Forbidden errors due to rate limiting. Since download URLs are deterministic (constructable from tag alone), the GitHub API is unnecessary. Now specific tags resolve instantly with zero network calls, and the latest version is resolved via the npm registry dist-tags.
5d67208 to
28b8f38
Compare
|
✅ Staging deployment successful! Preview: https://vp-setup-staging.void.app/ |
Include commit SHA in the comment body and reuse the existing comment on subsequent deploys instead of flooding the PR with new ones.
|
✅ Staging deployment successful! Preview: https://vp-setup-staging.void.app/ |
- Fix reflected XSS: replace innerHTML with DOM APIs in ARM64 link swap - Verify GitHub asset exists (HEAD probe) before caching npm-resolved version, preventing broken redirects during npm/GitHub sync windows - Make KV cache writes best-effort so transient KV errors don't fail otherwise valid requests - Use github.paginate for staging deploy PR comment lookup to handle PRs with many comments
Verify that HTML special characters and malicious tag payloads like attribute-breaking injections are properly escaped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetchGitHub,fetchRelease,parseRelease,GitHubReleaseinterface,GITHUB_TOKENenv var)getRelease()caching: specific tags bypass cache entirely, latest path retains KV cache with stale fallback for npm outagesFixes the
GitHub API error: 403 Forbidden for default tag v0.1.18production error caused by rate limiting.Test plan
vp test— 23 tests passvp check— no lint/type/format errorshttps://setup.viteplus.dev/renders download page with correct version?tag=v0.1.18and?arch=x64query params workGITHUB_TOKENsecret from Cloudflare Workers environment after deploy🤖 Generated with Claude Code