Skip to content

ci: stage-only npm publishing behind a protected environment - #11

Merged
tmack8001 merged 1 commit into
mainfrom
claude/fervent-bohr-g2mfh5
Oct 22, 2026
Merged

tmack8001 merged 1 commit into
mainfrom
claude/fervent-bohr-g2mfh5

Conversation

@tmack8001

@tmack8001 tmack8001 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

Description

Moves npm publishing and rollback behind a protected npm-publish environment and a maintainer-only gate, and switches publishing to npm's stage-only flow now that direct publishing with bypass-2FA tokens is being removed (January 2027).

Type of Change

  • Documentation update
  • Code refactoring

(CI/release tooling; no runtime code changes.)

Changes Made

  • actions/checkout and actions/setup-node bumped to @v5 in ci.yml, release.yml and rollback-release.yml.
  • Release: the npm step is now a separate publish_npm job bound to the npm-publish environment. The main job builds the tarball and passes it over as an artifact, and no longer needs id-token: write. publish_npm runs npm stage publish --access public --provenance with a stage-only NPM_TOKEN; a maintainer promotes it with npm stage approve and 2FA.
  • Rollback release: split into inspect (no token, covers dry runs), npm_actions (environment-bound: demote, deprecate, unpublish) and github_actions (delete release and tag).
  • All jobs are gated on github.triggering_actor == 'tmack8001'; the npm jobs also require refs/heads/main and a non-dry run.
  • docs/RELEASING.md: new "Protecting the npm token" section and the two-step stage/approve flow.

Platform(s) Affected

  • Documentation only

(No parser or CLI behaviour changes.)

Testing

  • Existing tests pass (npm test)

Not run: workflow YAML parses and the job graph was checked, but no workflow has executed on this branch. Known unverified points:

  • --provenance on npm stage publish is not confirmed supported.
  • upload-artifact@v5 / download-artifact@v5 versions are untested.
  • unpublish_npm may be rejected by a stage-only token (it can deprecate and move dist-tags).

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation

Documentation

  • Updated relevant docs in docs/ folder

Additional Notes

Merge before running Release again: the npm jobs only run from main. The npm-publish environment (main only, required reviewer, stage-only NPM_TOKEN as an environment secret) is already set up in repo settings.


Generated by Claude Code

@tmack8001
tmack8001 force-pushed the claude/fervent-bohr-g2mfh5 branch from 0ef6f3c to fb3c83c Compare October 22, 2026 15:32
- Publishing and npm rollback run in separate jobs bound to the npm-publish
  environment, gated on main and on the dispatching actor. Dry runs and
  GitHub-side rollback never reach NPM_TOKEN.
- Release stages with npm stage publish (stage-only token); a maintainer
  promotes the version with 2FA. Docs describe the flow.
- actions/checkout and setup-node bumped to v5.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W9Y5xJdDbjzZFbNfVFKS5b
@tmack8001
tmack8001 force-pushed the claude/fervent-bohr-g2mfh5 branch from fb3c83c to 5e09440 Compare October 22, 2026 15:32
@tmack8001
tmack8001 merged commit 1e912e5 into main Oct 22, 2026
10 checks passed
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