Commit ec3cf27
committed
fix(publish): remove dangerous --skip-checks flag and add comprehensive validation
BREAKING: CI publish workflow now runs full test suite before publishing
## Critical Security Fix
The publish:ci script was using --skip-checks which bypassed:
- Test suite validation
- Lint/type checking
- Code quality checks
This created a dangerous path where broken code could be published to npm,
potentially costing thousands in incident response and reputation damage.
## Changes
**publish:ci script**:
- Changed from --skip-checks to --skip-git
- Now only skips git-specific checks (safe in CI)
- Still runs full test + lint validation
**provenance.yml workflow**:
- setup-script now runs: test && check && build
- Ensures full validation before publish step
- Build artifacts validated before npm publish
**scripts/publish.mjs**:
- Removed CI restriction on --skip-build
- Added validateBuildArtifacts() function
- Validates dist/index.js, dist/index.d.ts, types/ exist
- Updated help text to clarify validation behavior
- Removed unused CI constant
## Safety Guarantees
CI publish will now FAIL if:
- ✗ Any test fails
- ✗ Lint/type errors exist
- ✗ Build artifacts missing
- ✗ Version already published
The --skip-build flag is safe because:
- setup-script builds first
- Artifact validation ensures build succeeded
- Fails immediately with clear error if missing
## What We Skip (and Why It's Safe)
--skip-git: Safe because CI runs on clean checkouts with branch protection
--skip-build: Safe because setup-script already built, we validate artifacts1 parent bc0af62 commit ec3cf27
File tree
3 files changed
+42
-11
lines changed- .github/workflows
- scripts
3 files changed
+42
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
236 | 235 | | |
237 | 236 | | |
238 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
239 | 269 | | |
240 | 270 | | |
241 | 271 | | |
| |||
464 | 494 | | |
465 | 495 | | |
466 | 496 | | |
467 | | - | |
| 497 | + | |
468 | 498 | | |
469 | 499 | | |
470 | 500 | | |
| |||
480 | 510 | | |
481 | 511 | | |
482 | 512 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | 513 | | |
491 | 514 | | |
492 | 515 | | |
| |||
515 | 538 | | |
516 | 539 | | |
517 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
518 | 549 | | |
519 | 550 | | |
520 | 551 | | |
| |||
0 commit comments