Skip to content

feat(release): make commit-to-release policy a consumer input - #12

Merged
chhoumann merged 1 commit into
mainfrom
feat/release-policy
Jul 11, 2026
Merged

feat(release): make commit-to-release policy a consumer input#12
chhoumann merged 1 commit into
mainfrom
feat/release-policy

Conversation

@chhoumann

Copy link
Copy Markdown
Owner

Adds a release-policy input to release-prepare.yml and release.yml: a JSON list of semantic-release releaseRules (string and boolean matchers, release: false|major|minor|patch, at least one matcher per rule) that release-plan.mjs validates via the new parseReleasePolicy and applies instead of the former RELEASE_RULES module constant (now DEFAULT_RELEASE_RULES, used when the input is empty). The effective policy is recorded as releasePolicy in the plan JSON, so the uploaded prepare artifact carries the provenance of what classified the release.

Why: release classification was global toolkit policy - a shared tag move changed every consumer at once, including in-flight histories. Package manager, assets, and build commands are already consumer inputs; commit-to-release policy now is too. Caller stubs should pin the policy explicitly in both the prepare and release stubs (template update lands with the validate PR in this stack).

Deliberately not digest-bound into the commit/PR marker: the policy only decides the version bump - notes and the release diff are policy-independent - so a prepare/release mismatch either produces the identical release or fails closed on the release stage's existing --expected-version recompute. Binding a digest would bump the marker schema and break recovery of already-merged release PRs for no added enforcement.

Fixes #7

@chhoumann
chhoumann merged commit 951ac04 into main Jul 11, 2026
1 check passed
@chhoumann
chhoumann deleted the feat/release-policy branch July 11, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make commit-to-release policy a consumer input instead of toolkit constant

1 participant