fix(ci): only publish to npm when source, package, or README changes #32

Closed
jmiller wants to merge 1 commits from fix/npm-publish-change-gate into dev
Owner

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

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
jmiller added 1 commit 2026-07-18 16:42:02 +00:00
fix(ci): only publish to npm when source, package, or README changes
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 15s
Branch Policy Check / Verify merge target (pull_request) Successful in 2s
Universal: PR Check / Branch Policy (pull_request) Successful in 3s
Universal: PR Check / Secret Scan (pull_request) Successful in 10s
Universal: PR Check / Validate PR (pull_request) Successful in 8s
Universal: Auto-Assign / Assign unassigned issues and PRs (pull_request_target) Successful in 2s
Generic: Project CI / Lint & Validate (pull_request) Successful in 25s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Branch Cleanup / Delete merged branch (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
7d2fea270b
Add a Detect step (fetch-depth 2) that diffs the push and gates the
Setup/Install/Build/Auto-bump/Publish steps on a real change to
src/**, package.json, package-lock.json, tsconfig.json, or README.md.
Manual dispatch and shallow/first commits always publish. Keeps the
npm README (publish data) current without churning versions on chore
or workflow-sync pushes. Single job (no needs:) so the runner dispatches it.

Authored-by: Moko Consulting
Author
Owner

Closing as superseded by #33 (merged to main via #39).

PR #32 gated npm publishing on a hardcoded ^src/ change filter, which conflicts with the Moko standard (source/, not src/) and duplicates a value that already lives authoritatively in the metadata API (entry_point). #33 reimplements the gate on top of the resolve-source-dir composite action (reads entry_point, cross-checks the Makefile, fail-closed, errors on conflict), so the gate can't drift from the real source dir. The src/ → 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

Closing as **superseded by #33** (merged to `main` via #39). PR #32 gated npm publishing on a hardcoded `^src/` change filter, which conflicts with the Moko standard (`source/`, not `src/`) and duplicates a value that already lives authoritatively in the metadata API (`entry_point`). #33 reimplements the gate on top of the `resolve-source-dir` composite action (reads `entry_point`, cross-checks the Makefile, fail-closed, errors on conflict), so the gate can't drift from the real source dir. The `src/ → 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
jmiller closed this pull request 2026-07-18 18:29:12 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.