feat: require manual approval before npm publish + drop release-as pin#369
Conversation
The publish-npm job now targets the npm-publish environment, whose required-reviewer rule pauses the job for maintainer approval in the Actions UI before anything reaches the registry. Also removes the release-as 0.1.0 pin from release-please-config.json now that v0.1.0 has shipped — leaving it would stamp every future release 0.1.0.
Zero automated PR reviewVerdict: No blockers found Blockers
Validation
ScopeHead: This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR adds a manual approval environment gate ( ChangesRelease CI and Config Adjustments
Estimated code review effort: 1 (Trivial) | ~3 minutes Related Issues: None referenced. Related PRs: None referenced. Suggested labels: ci, release Suggested reviewers: None specified. 🐇 A gate now guards the npm release, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Vasanthdev2004
left a comment
There was a problem hiding this comment.
Verdict: Approve ✅
Two small, correct, low-risk release-pipeline changes. Verified both against the current main config.
1. npm-publish environment gate — correct
- Job-level
environment: { name, url }is valid Actions schema;urlpoints at the real package (@gitlawb/zero). ✔ - OIDC interaction checked: referencing an environment adds
environment:npm-publishto the OIDCsubclaim. npm trusted publishing treats the environment as an optional matcher, so publishing keeps working whether or not the npmjs.com trusted-publisher config names an environment — and if it later does, it must match exactly (the PR body already says so). No regression to the existing OIDC path. ✔
2. Dropping release-as: 0.1.0 — correct and necessary
.release-please-manifest.jsonrecords{".":"0.1.0"}, so the version baseline is preserved; future releases are computed from conventional commits. Leaving the pin in would have stamped every release as 0.1.0. ✔
⚠️ One required post-merge action (not a code defect)
GitHub auto-creates a referenced environment without protection rules, so merging this alone does not gate anything — the next tagged release would still publish to npm unattended until a maintainer sets Settings → Environments → npm-publish → Required reviewers. The PR body documents this, but it's worth tracking as a hard follow-up so the gate isn't silently inert. Recommend doing it immediately after merge (before the next v* tag), and optionally binding the environment name in the npmjs.com trusted-publisher config for defense-in-depth.
No blocking issues. CI/config-only, no Go changes; build/vet/test + gofmt claims are consistent with the diff.
Summary
Two post-launch hardening changes to the release pipeline, now that v0.1.0 has shipped to npm:
publish-npmjob inrelease-artifacts.ymlnow targets anpm-publishdeployment environment. With a required-reviewer rule on that environment, every release pauses after the GitHub Release and platform artifacts are published, and nothing reaches the npm registry until a maintainer approves the job in the Actions UI. The environment also carries the package URL so the approval prompt links straight to npmjs.com.release-as: 0.1.0pin fromrelease-please-config.json. It existed only to force the version of the first release; now that v0.1.0 is tagged and published, leaving it in place would stamp every future release as 0.1.0. Versions are computed from conventional commits from here on.Post-merge setup (one-time): GitHub auto-creates a referenced environment without protection rules, so the gate is only real once configured — Settings → Environments →
npm-publish→ add Required reviewers. Optionally setnpm-publishas the environment in the npmjs.com trusted-publisher config to bind OIDC publishing exclusively to approved runs (names must match exactly).Linked issue
Fixes #
Checklist
issue-approvedlabel.go build ./...,go vet ./..., andgo test ./...pass locally.gofmtclean.-racewhere relevant). — N/A: no Go code changed; workflow YAML and config JSON re-validated by parsing.Summary by CodeRabbit