You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add npmStaged publish config for npm staged publishing (#76)
## Summary
- Adds `npmStaged` boolean to `PublishConfig` (default: `false`) to opt
into npm's staged publishing feature (`npm stage publish`)
- When enabled, packages are staged on npmjs.com and require manual 2FA
approval before going live
- Validates that `publishManager` is `"npm"` and npm version is >=
11.5.1, with helpful warnings otherwise
- Updated docs and added test coverage
- Updated frog clipboard image
## Test plan
- [x] Existing publish-pipeline tests pass (6/6)
- [x] New test verifies `npm stage publish` command is used when
`npmStaged: true`
- [x] Typecheck passes
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ Fixed locale fallback logic in utils.
50
50
51
51
-**All package managers** - npm, pnpm, yarn, and bun workspaces
52
52
-**Smart dependency propagation** - configurable rules for how version bumps cascade through your dependency graph (see [version propagation docs](https://github.com/dmno-dev/bumpy/blob/main/docs/version-propagation.md))
53
-
-**Pack-then-publish** - by default, publishes to npm (resolving `workspace:` and `catalog:` protocols, with OIDC/provenance support). Per-package custom publish commands let you target anything - VSCode extensions, Docker images, JSR, private registries, etc.
53
+
-**Pack-then-publish** - by default, publishes to npm (resolving `workspace:` and `catalog:` protocols, with OIDC/provenance support). Supports [npm staged publishing](https://docs.npmjs.com/about-staged-publishes) for 2FA-gated releases. Per-package custom publish commands let you target anything - VSCode extensions, Docker images, JSR, private registries, etc.
54
54
-**Flexible package management** - include/exclude any package individually via per-package config, glob patterns, or `privatePackages` setting
55
55
-**Non-interactive CLI** - `bumpy add` works fully non-interactively for CI/CD and AI-assisted development
56
56
-**Aggregated GitHub releases** - optionally create a single consolidated release instead of one per package
Copy file name to clipboardExpand all lines: docs/configuration.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,25 @@ The `publish` object controls how packages are packed and published:
68
68
|`publishManager`|`string`|`"npm"`| Which tool runs `publish` (npm supports OIDC/provenance) |
69
69
|`publishArgs`|`string[]`|`[]`| Extra args passed to publish (e.g., `["--provenance"]`) |
70
70
|`protocolResolution`|`"pack" \| "in-place"`|`"pack"`| How `workspace:` and `catalog:` protocols are resolved |
71
+
|`npmStaged`|`boolean`|`false`| Use `npm stage publish` — requires 2FA approval on npmjs.com |
72
+
73
+
#### Staged publishing
74
+
75
+
When `npmStaged` is enabled, bumpy uses `npm stage publish` instead of `npm publish`. This stages packages on npmjs.com, where they must be manually approved with 2FA before going live. This adds an extra security gate to your release process — even if CI credentials are compromised, packages can't be published without maintainer approval.
76
+
77
+
Requirements:
78
+
79
+
-`publishManager` must be `"npm"` (the default)
80
+
- npm >= 11.5.1
81
+
-[npm trusted publishing (OIDC)](https://docs.npmjs.com/trusted-publishers/) configured for your repo
82
+
83
+
```json
84
+
{
85
+
"publish": {
86
+
"npmStaged": true
87
+
}
88
+
}
89
+
```
71
90
72
91
### Version PR config
73
92
@@ -210,6 +229,9 @@ See the [Changelog Formatters](./changelog-formatters.md) docs for full details
Copy file name to clipboardExpand all lines: docs/github-actions.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,8 @@ jobs:
72
72
73
73
**Trusted publishing setup:** Configure each package on [npmjs.com](https://docs.npmjs.com/trusted-publishers/) → Package Settings → Trusted Publishers → GitHub Actions. Specify your org/user, repo, and the workflow filename (`bumpy-release.yml`).
74
74
75
+
> **Staged publishing:** For an extra layer of security, enable `npmStaged` in your [publish config](./configuration.md#staged-publishing). This uses `npm stage publish` to stage packages on npmjs.com, requiring manual 2FA approval before they go live — even if your CI credentials are compromised, nothing gets published without maintainer approval.
76
+
75
77
### Token-based auth (NPM_TOKEN)
76
78
77
79
If you can't use trusted publishing, use an npm access token instead:
0 commit comments