Repository navigation
ci: enforce version-only-on-release-branches - #37
Merged
Merged
Conversation
Adds two layers of protection so the 'version' field can never be casually bumped: 1. AGENTS.md §4 — new 'Version Bumps' subsection (sibling to the npm Publish prohibition): two hard rules — version changes ONLY on *_release-v* branches, and a release commit changes ONLY version. Includes the reason (CI trigger detection + merge-conflict avoidance) and a canned reply for when a human asks to bundle a version bump into content. 2. ci.yml — new 'version-guard' job that runs on every PR: if the branch is NOT *_release-v* and the diff touches the '"version"' line in package.json, the job fails with a ::error annotation. Release branches skip the check. This prevents the exact failure that hit PR#32 (version bundled into a non-release context → three-way merge conflict + broken CI trigger).
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.
What
Adds a hard constraint so
versioncan NEVER be casually bumped — it must go through the standard release flow (§5).Two layers
1. AGENTS.md §4 — new
Version Bumpssubsection (sibling to the existingnpm Publishprohibition):versionchanges ONLY on*_release-v*branchesversion(+ lockfile drift)2.
ci.yml— newversion-guardjob (enforced, not just documented):*_release-v*AND the diff touches"version"in package.json → job fails with::error*_release-v*) skip the checkVerified locally
Why
Prevents the exact failure that hit PR#32: version bundled into a non-release context → three-way merge conflict + broken CI trigger. With this guard that PR would have failed CI before merge.
No version field changed in this PR (the guard runs on itself ✓). Docs + CI only.