fix(release): install pinned canary Deno via direct download#1309
fix(release): install pinned canary Deno via direct download#1309
Conversation
The previous attempt (#1308) passed `canary-<sha>` to `denoland/setup-deno@v2`, which fails with "The passed version range is not valid": setup-deno only accepts `canary` (latest, non- reproducible) for the canary channel. Pinning to a specific commit SHA isn't a supported form. Replace the Setup Deno step with a direct download of the pinned artifact from `dl.deno.land/canary/<sha>/`, and prepend the install directory to GITHUB_PATH so subsequent `deno run` / `deno compile` calls pick it up. This keeps the host Deno reproducible (same SHA the resource embed uses) without depending on setup-deno's canary-version syntax. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
Blocking Issues
None.
Suggestions
-
Back-out checklist drift (
scripts/deno_canary.txt:21-23): Step 3 of the checklist still references the old two-step approach ("delete the 'Resolve Deno canary SHA' step … and change the Setup Deno step'sdeno-versionback tov2.x"). This PR consolidated those into a single "Install pinned canary Deno" step and removed thesetup-denoaction entirely. Consider updating the checklist to say something like: "In.github/workflows/release.yml, delete the 'Install pinned canary Deno' step (marked CANARY-BRIDGE) and replace it with adenoland/setup-deno@v2step pinned tov2.8.x(or the desired stable line)." Not blocking since this is a temporary bridge that will be removed wholesale when v2.8.0 ships — whoever follows the checklist will easily figure it out. -
No integrity check on the downloaded zip: The
curldownload doesn't verify a checksum of the fetched artifact. This is consistent with howdenoland/setup-denoitself handles canary builds (no hash verification there either), and the download is over HTTPS from Deno's official CDN, so the practical risk is very low. Noting it for completeness only.
Overall: clean, well-motivated fix. The comment block explains the "why" clearly, the SHA is sourced from the reviewed repo file, curl -f will fail loudly on HTTP errors, and deno --version at the end provides a smoke check. LGTM.
There was a problem hiding this comment.
CI Security Review
Critical / High
None.
Medium
- No integrity verification of downloaded binary (
release.yml:53): Thecurldownload fromdl.deno.landtrusts the server to return the correct artifact — there is no checksum verification after download. However, this is the same trust boundary as the previousdenoland/setup-deno@v2approach (which itself downloads fromdl.deno.land), and the SHA-pinned URL is actually more deterministic than the tag-pinned action it replaces. Suggested improvement (non-blocking): If Deno publishes checksums for canary builds, verifysha256sumafter download.
Low
- Pre-existing: Docker actions use tag-only pins (
release.yml:222-256):docker/setup-qemu-action@v3,docker/setup-buildx-action@v3,docker/login-action@v3, anddocker/build-push-action@v6are pinned by tag rather than full SHA. These are from Docker (trusted publisher) and are not introduced by this PR.
Verdict
PASS — The change is security-neutral to slightly positive. It replaces a tag-pinned third-party action (denoland/setup-deno@v2) with a deterministic, SHA-pinned direct download. The SHA is sourced from scripts/deno_canary.txt checked out from main (line 29 ref: main), so it requires repo write access to tamper with. No untrusted input is interpolated in the new run: block, no new secrets are introduced, and no expression injection vectors are created.
Summary
Follow-up to #1308. The release job now fails with:
denoland/setup-deno@v2only acceptscanary(latest, non-reproducible) for the canary channel — thecanary-<sha>form is parsed as a semver range and rejected. My previous PR was wrong about that syntax.Change
Replace the Setup Deno step with a direct download of the pinned artifact from
https://dl.deno.land/canary/<sha>/deno-x86_64-unknown-linux-gnu.zipand prepend the install directory toGITHUB_PATHso subsequentdeno run/deno compileinvocations pick it up. The SHA is still read fromscripts/deno_canary.txt(the existing single source of truth), so reproducibility is preserved.The release runner is
ubuntu-latest, so we only need the linux x86_64 host artifact —deno compilethen cross-compiles to the other targets and fetches the matching cross-targetdenortfromdl.deno.land/canary/<sha>/itself (verified all fivedenort-*.zipartifacts are present at the pinned SHA).The
CANARY-BRIDGEmarker stays in place; the back-out checklist inscripts/deno_canary.txtalready references this step.Test plan
Pinned Deno canary: 19bd3d8b..., theunzipsucceeds, anddeno --versionprints the canary build.deno run -A scripts/compile.tssteps logDownload https://dl.deno.land/canary/19bd3d8b.../denort-...zip(notrelease/v2.7.14/).stableswamp; the S3 upload should complete without thetls_wrap.rs:2018:31panic.🤖 Generated with Claude Code