Skip to content

Pre-publication hardening: pin publish pipeline, hermetic build, .env permissions - #3

Merged
njb90 merged 1 commit into
mainfrom
harden-publish-pipeline
Aug 3, 2026
Merged

Pre-publication hardening: pin publish pipeline, hermetic build, .env permissions#3
njb90 merged 1 commit into
mainfrom
harden-publish-pipeline

Conversation

@njb90

@njb90 njb90 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Hardening ahead of the public launch — no functional changes to the CLI.

  • Pin the publish pipeline: actions/checkout and actions/setup-node pinned to commit SHAs (v4.4.0) in both workflows; npm@latest replaced with npm@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.
  • Hermetic build: new clean script (portable fs.rmSync, no rm -rf) runs before tsc. tsc never deletes orphaned outputs, so a locally built tarball could otherwise include files that were never in git review.
  • .env created owner-only (0600): the file holds the cloud's API secret. Applies on creation only; a pre-existing .env keeps whatever permissions the user gave it. Regression test added (skipped on Windows).
  • Comment wording tweak in publish.yml.

Test plan

  • npm test — 52/52 pass (includes new permissions test)
  • npm pack --dry-run — tarball contains only expected dist/ files
  • CI green on this PR (exercises the pinned actions)

🤖 Generated with Claude Code

- 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
@njb90
njb90 merged commit 94d540f into main Aug 3, 2026
4 checks passed
@njb90
njb90 deleted the harden-publish-pipeline branch August 3, 2026 18:10
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