Skip to content

Check the release tarball name against the install URL - #23

Merged
imanimanyara merged 2 commits into
mainfrom
feat/release-tarball-name-guard
Nov 13, 2026
Merged

imanimanyara merged 2 commits into
mainfrom
feat/release-tarball-name-guard

Conversation

@imanimanyara

Copy link
Copy Markdown
Contributor

Summary

Both install paths stay supported (Q19): the prebuilt release tarball for applications, the git install for contributors.

  • release.yml already builds the package once on every v* tag push (and vX.Y.Z-rc.N, as a pre-release) and attaches ichava-js-icon-components-X.Y.Z.tgz, the per-pack tarballs and SHA256SUMS. v0.1.0's release carries it (7 assets). What was missing was a link between that name and tarballUrl() in scripts/prepare.mjs, which the "install": "tarball" refusal prints: the workflow hard-coded the name separately.
  • New scripts/check-release-name.mjs runs in release.yml after packing and before publishing. It fails unless the release directory holds basename(tarballUrl(version)) for the tag, the URL points at that tag's download, and SHA256SUMS lists it.
  • tests/release-name.test.ts: final and pre-release tags, a drifted name, a missing checksum line, the script's exit codes, and the workflow step's position between packing and publishing. tests/tarball.test.ts now asserts the packed name equals tarballUrl()'s.
  • README Install and docs/installation.md lead with the tarball (npm install of the release URL, then the SHA256SUMS check), then the git install for contributors or a pinned commit. docs/release.md names the new check. The git install and prepare are unchanged.
  • CHANGELOG: under [Unreleased], since the v0.1.0 tag is final and this is not in its tree.

Verification

  • npm run lint, npm run typecheck, npm run build, npx vitest run: 30 files, 420 tests pass (Node 26).
  • Guard proven red: renaming the file in tarballUrl() failed 4 of 6 tests in release-name.test.ts and made the script exit 1 against a release directory with the real name; replacing the workflow step failed the step-position test. Both reverted.
  • The documented checksum command run against the real v0.1.0 release: ichava-js-icon-components-0.1.0.tgz: OK.
  • npm run check:config-drift could not fetch from raw.githubusercontent.com locally (sandbox); no config file changed.

release.yml now fails before publishing unless the full tarball carries the
exact name and tag that prepare.mjs prints for an "install": "tarball"
refusal, and SHA256SUMS lists it. Pre-release tags are checked the same way.
The README and installation guide lead with npm install of the release
URL and the SHA256SUMS check, then the git install for contributors or a
pinned commit. The git install itself is unchanged.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@imanimanyara
imanimanyara merged commit b80f1c0 into main Nov 13, 2026
8 checks passed
@imanimanyara
imanimanyara deleted the feat/release-tarball-name-guard branch November 13, 2026 20:48
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.

2 participants