Pre-publication hardening: pin publish pipeline, hermetic build, .env permissions - #3
Merged
Merged
Conversation
- pin GitHub Actions to commit SHAs and npm to 12.0.2 so the publish job never executes an unreviewed upstream release - clean dist/ before every build; tsc leaves orphaned outputs, so locally built tarballs could ship files absent from git - create .env with mode 0600 (owner-only) since it holds the cloud's API secret; pre-existing files keep their permissions
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
Hardening ahead of the public launch — no functional changes to the CLI.
actions/checkoutandactions/setup-nodepinned to commit SHAs (v4.4.0) in both workflows;npm@latestreplaced withnpm@12.0.2(still ≥ 11.5.1 for trusted publishing). The publish job holds the npm credential, so it should never execute an unreviewed upstream release. Kept on the v4 major — upgrading to v7 can be its own PR.cleanscript (portablefs.rmSync, norm -rf) runs beforetsc.tscnever deletes orphaned outputs, so a locally built tarball could otherwise include files that were never in git review..envcreated owner-only (0600): the file holds the cloud's API secret. Applies on creation only; a pre-existing.envkeeps whatever permissions the user gave it. Regression test added (skipped on Windows).publish.yml.Test plan
npm test— 52/52 pass (includes new permissions test)npm pack --dry-run— tarball contains only expecteddist/files🤖 Generated with Claude Code