Repository navigation
ci: gate publish on unreleased shipping changes (#7) - #12
Merged
Merged
Conversation
Without a guard every merge to main publishes: a devDependency bump, a package-lock refresh, an audit `overrides` addition and a workflow-only edit each cut a patch. This wave did exactly that — 0.1.7 (audit fixes) and 0.1.8 (`.github` only). Port the release guard already used by pcbway-mcp-server and google-services-mcp, adapted to this repo: - `Determine whether there are unreleased shipping changes` diffs the newest stable `v*` tag against the pushed SHA and classifies every path. - `package-lock.json` and `.github/**` never ship. `package.json` is non-shipping only when the sole differences are inert devDependencies (the explicit lint-only list); a `version` bump ships (it means "publish this version"), and `overrides` ships unless the package has no runtime dependency for it to affect. - Build, publish, tag and both Release steps are gated on `changed == 'true'`. - Baseline is `git tag --merged <sha>` filtered to plain `vX.Y.Z`: `git describe` would accept `v1.1.0-rc.1`/`v2`/`vdocs` and hide commits after the last real release. No stable tag yet = first release, which publishes (skipping would never create the baseline tag). - The `test` job's concurrency group no longer cancels `main` runs, which could kill a shipping run's `publish` job. - `workflow_dispatch` and `v*-beta*` tag pushes always publish. Verified locally against this repo's real history and synthetic commits: lock-only, `.github`-only and inert-devDep bumps => false; version bump, non-inert devDep, `overrides` with a runtime dep, `index.js` and README => true; the 0.1.7 audit merge => false; a stray `v2.0.0-rc.1` tag is ignored; no-tag => true; a path containing a newline stays one entry (-z).
nabheet
force-pushed
the
ci/release-guard-7
branch
from
October 31, 2026 19:55
1917102 to
0b32908
Compare
nabheet
marked this pull request as ready for review
October 31, 2026 19:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the release guard the standard calls for (§14) to the two npm-server repos that never adopted it. Closes
nabheet/galactic-config#7.Why
Every merge to
mainpublished. In this wave:0.1.7(dev-only auditoverrides) and0.1.8(.github/workflows/ci.ymlonly). Neither changed anything a consumer installs, yet each pushed a tag and a GitHub Release.What
The
publishjob gainsDetermine whether there are unreleased shipping changes(structure frompcbway-mcp-server, adapted to this toolchain). It writeschanged=true|false; build, publish, tag and both Release steps are gated on it.Rule:
package-lock.json,.github/**, andpackage.jsonwhose only differences areversionor inert devDependencies.markdownlint-cli2(rtk) /@biomejs/biome+markdownlint-cli2(failover) — lint only, never in the published package.overridesships when the package has a runtime dependency (dependencies/optionalDependencies/peerDependencies/bundledDependenciesnon-empty), because it changes what consumers install; otherwise it can only touch the dev tree and is ignored. Same rule as pcbway/google-services.versionis derived (newest stable tag vs registry, then patch), so a lone bump releases nothing; land it with the change it releases. A release that runs with the tree version ahead of both baselines still publishes it as-is.index.js, README, other published files).Other hardening in the same job:
git tag --merged <sha>filtered to plainvX.Y.Z.git describe --match 'v*'would acceptv1.1.0-rc.1/v2/vdocsand hide commits after the last real release.testjob concurrency no longer cancelsmainruns; cancellation killspublish, which with a guard could then skip a release.workflow_dispatchandv*-beta*tag pushes always publish.Verification (local, real history + synthetic commits)
.github/**onlychanged=falsepackage-lock.jsononlychanged=falseversionbump onlychanged=falsechanged=falsechanged=trueindex.js/ README changechanged=trueoverrides, no runtime deps)changed=falseoverrideswith a runtime dependency presentchanged=truev2.0.0-rc.1tag presentv0.1.8changed=trueworkflow_dispatchchanged=true-z)actionlintclean;bash -nclean on the extracted step;yqconfirms the gate on every publish step and the newtestconcurrency group.The previous PR revision already merged the guard; merging this one is a
.github-only change, sochanged=falseon the merge run remains the live check.