Template
fix(ci): only publish to npm when source, package, or README changes #32
Reference in New Issue
Block a user
Delete Branch "fix/npm-publish-change-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
npm-publish.yml now gates publishing on a real content change.
Why: the workflow published on every push to main (unless [skip ci]), which caused version churn on chore/workflow-sync pushes and required remembering [skip ci]. It also meant README-only updates were easy to miss on npm.
What: a Detect step (checkout fetch-depth 2) diffs HEAD~1..HEAD; Setup/Install/Build/Auto-bump/Publish run only if src/**, package.json, package-lock.json, tsconfig.json, or README.md changed. workflow_dispatch and shallow/first commits always publish. Single job (no needs:) so it dispatches on the self-hosted runner.
Cascades to child npm repos via workflow-sync on merge to Template-NPM main.
https://claude.ai/code/session_01D4REEaFAKdMPfijyUeBbrh
Closing as superseded by #33 (merged to
mainvia #39).PR #32 gated npm publishing on a hardcoded
^src/change filter, which conflicts with the Moko standard (source/, notsrc/) and duplicates a value that already lives authoritatively in the metadata API (entry_point). #33 reimplements the gate on top of theresolve-source-dircomposite action (readsentry_point, cross-checks the Makefile, fail-closed, errors on conflict), so the gate can't drift from the real source dir. Thesrc/ → source/migration (#34) and two-zip release (#35) also landed. This branch is now on a stale base; no work is lost.Authored-by: Moko Consulting
Pull request closed