Skip to content

fix(release): install pinned canary Deno via direct download#1309

Merged
stack72 merged 1 commit intomainfrom
fix/release-canary-host-deno-direct-download
May 5, 2026
Merged

fix(release): install pinned canary Deno via direct download#1309
stack72 merged 1 commit intomainfrom
fix/release-canary-host-deno-direct-download

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented May 5, 2026

Summary

Follow-up to #1308. The release job now fails with:

Run denoland/setup-deno@v2
  with:
    deno-version: canary-19bd3d8b99d92f15d20692aca02ac059bbc9ada7
Error: The passed version range is not valid.

denoland/setup-deno@v2 only accepts canary (latest, non-reproducible) for the canary channel — the canary-<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.zip and prepend the install directory to GITHUB_PATH so subsequent deno run / deno compile invocations pick it up. The SHA is still read from scripts/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 compile then cross-compiles to the other targets and fetches the matching cross-target denort from dl.deno.land/canary/<sha>/ itself (verified all five denort-*.zip artifacts are present at the pinned SHA).

The CANARY-BRIDGE marker stays in place; the back-out checklist in scripts/deno_canary.txt already references this step.

Test plan

  • Merge → release runs → confirm log shows Pinned Deno canary: 19bd3d8b..., the unzip succeeds, and deno --version prints the canary build.
  • Subsequent deno run -A scripts/compile.ts steps log Download https://dl.deno.land/canary/19bd3d8b.../denort-...zip (not release/v2.7.14/).
  • Re-run the swamp-club Deploy job on the resulting stable swamp; the S3 upload should complete without the tls_wrap.rs:2018:31 panic.

🤖 Generated with Claude Code

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>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Blocking Issues

None.

Suggestions

  1. 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's deno-version back to v2.x"). This PR consolidated those into a single "Install pinned canary Deno" step and removed the setup-deno action 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 a denoland/setup-deno@v2 step pinned to v2.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.

  2. No integrity check on the downloaded zip: The curl download doesn't verify a checksum of the fetched artifact. This is consistent with how denoland/setup-deno itself 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.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI Security Review

Critical / High

None.

Medium

  1. No integrity verification of downloaded binary (release.yml:53): The curl download from dl.deno.land trusts the server to return the correct artifact — there is no checksum verification after download. However, this is the same trust boundary as the previous denoland/setup-deno@v2 approach (which itself downloads from dl.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, verify sha256sum after download.

Low

  1. 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, and docker/build-push-action@v6 are 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.

@stack72 stack72 merged commit 78cf245 into main May 5, 2026
22 of 23 checks passed
@stack72 stack72 deleted the fix/release-canary-host-deno-direct-download branch May 5, 2026 16:36
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.

1 participant