Commit 663256e
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
- Added dist-tag input parameter
**scripts/publish.mjs**:
- Removed CI restriction on --skip-build
- Added validateBuildArtifacts() function
- Validates dist/index.js, dist/index.d.ts 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 77ae8a7 commit 663256e
File tree
3 files changed
+44
-10
lines changed- .github/workflows
- scripts
3 files changed
+44
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| 32 | + | |
27 | 33 | | |
28 | | - | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
204 | 203 | | |
205 | 204 | | |
206 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
207 | 230 | | |
208 | 231 | | |
209 | 232 | | |
| |||
432 | 455 | | |
433 | 456 | | |
434 | 457 | | |
435 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
436 | 461 | | |
437 | 462 | | |
438 | 463 | | |
| |||
448 | 473 | | |
449 | 474 | | |
450 | 475 | | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | 476 | | |
459 | 477 | | |
460 | 478 | | |
| |||
483 | 501 | | |
484 | 502 | | |
485 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
486 | 512 | | |
487 | 513 | | |
488 | 514 | | |
| |||
0 commit comments