feat: recognize security: commit prefix for changelog and versioning#802
Merged
feat: recognize security: commit prefix for changelog and versioning#802
security: commit prefix for changelog and versioning#802Conversation
Adds a dedicated 'Security 🔒' category to the default release config, positioned between Breaking Changes and New Features. Matches commits like `security:`, `security(scope):`, `security!:` and `security(scope)!:`. Non-breaking security commits contribute a `patch` bump to auto-versioning; breaking variants are still intercepted by the Breaking Changes category (which is listed first) and contribute a `major` bump. Pattern mirrors the existing `feat:`/`fix:` structure exactly, so scope extraction, title stripping, and case-insensitive matching all work without further wiring. Users who customize `.github/release.yml` can override or re-order the new category as usual.
Contributor
|
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.
Summary
Adds a dedicated Security 🔒 category to the default release config, positioned between Breaking Changes and New Features. Commits prefixed
security:(with optional scope and/or breaking marker!) are now recognized for both changelog grouping and auto-versioning.security: patch XSSsecurity(auth): fix login bypassauthwhen multiple)security!: rotate signing keyssecurity(auth)!: rotate keysWhy a dedicated section vs. folding into Bug Fixes
securityas a first-class type.Design choices
feat:/fix:so asecurity:commit is never swallowed by a broader catch-all, but below Breaking Changes sosecurity!:still escalates tomajor(consistent with every other type).^(?<type>security(?:\((?<scope>[^)]+)\))?!?:\s*)mirrors the existingfeat:/fix:patterns exactly — scope extraction, title stripping and case-insensitive matching all work without further wiring.patch, matching howfix:is treated.security!:escalates tomajorvia Breaking Changes.Changes
src/utils/changelog.ts— one new category inserted inDEFAULT_RELEASE_CONFIG.docs/src/content/docs/configuration.md— Default Configuration YAML snippet updated to include the Security entry so users copy-pasting it as a customization starting point get parity with the real default.getBumpTypeForPRfor plain, scoped, breaking, scoped-breaking, case-insensitive, and lookalike-rejection cases.stripTitlefor thesecuritytype (plain + scoped).extractScopeforsecurity(auth):andsecurity(auth)!:.generateChangesetFromGitcases covering: Security section rendering, ordering (Security above New Features above Bug Fixes), mixed-with-docs:aggregation stayspatch, andsecurity!:escalating to Breaking Changes /major.Verification
pnpm test— all new tests pass; 972 total pass. The 7 failures are the pre-existing environment-dependentEDITOR unsetfailures insrc/__tests__/prepare-dry-run.e2e.test.ts(documented in AGENTS.md), unrelated to this change.pnpm lint— clean (only pre-existing warnings insrc/utils/git.ts).pnpm build— clean.Non-goals
BUMP_TYPESpriority map..github/release.yml(the standardreadReleaseConfigmechanism).