fix: reject unsupported platform/arch with a clear error#59
Merged
Conversation
mapPlatform/mapArch previously passed unknown values through verbatim, so non-Linux or unsupported-arch runners built a non-existent release asset URL and failed with an opaque HTTP 404. They now validate against the supported set (linux; x64, arm64) and throw a descriptive error naming the offending value and the supported options, which propagates to core.setFailed via main.ts's existing try/catch. https://claude.ai/code/session_01KRw2Ny9D8PDaA6sbetBEAj
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
mapPlatform/mapArchinsrc/releases.tspreviously passed unknown values through verbatim. On a macOS, Windows, or unsupported-arch runner this produced a non-existent release asset name (e.g.cli_darwin_arm64.tar.gz), and the download then failed with an opaque HTTP 404 surfaced viacore.setFailed.linux;x64,arm64) and throw a descriptive, actionable error naming the offending value and the supported options.main.ts's existingtry/catchintocore.setFailed, so users get a clear "Unsupported platform/architecture" message instead of a confusing 404.src/main.tsneeded no changes.dist/bundle regenerated to reflect the source change.Test plan
__tests__/releases.test.ts: replaced the passthrough assertions with throw assertions fordarwin/win32/ia32, and addedgetDownloadUrlregression tests that throw on unsupported platform/archlinux→Linux,x64→x86_64,arm64→arm64, Linux x64/arm64 URL formattingnpm run test— 33/33 green,releases.ts100% coveragenpm run lint,npm run format:check,npm run package— all cleanThis finding was surfaced by
/huntand fixed via/task.https://claude.ai/code/session_01KRw2Ny9D8PDaA6sbetBEAj
Generated by Claude Code