Skip to content

feat: support multiple regex patterns per bump level (OR logic) #13

@mwaldheim

Description

@mwaldheim

Summary

Allow specifying multiple regular expressions for each bump level. The bump is triggered when any of the configured patterns matches a commit message (OR semantics).

Motivation

Different commit message styles coexist in many repositories — for example a project that mixes Conventional Commits with legacy [feature] tags. A single regex can model this, but complex alternations become hard to read and maintain.

Current behaviour

Each bump level accepts a single regex:

SEMREL_PLUGIN_MINOR_PATTERN=^feat(\(.+\))?:
SEMREL_PLUGIN_PATCH_PATTERN=^(fix|perf|refactor)(\(.+\))?:

Proposed behaviour

Comma-separated list of patterns (OR semantics):

SEMREL_PLUGIN_MINOR_PATTERNS=^feat(\(.+\))?:,^\[feature\]
SEMREL_PLUGIN_PATCH_PATTERNS=^(fix|perf)(\(.+\))?:,^\[bugfix\],^\[hotfix\]
SEMREL_PLUGIN_MAJOR_PATTERNS=BREAKING CHANGE,^\[breaking\]

Backward compatibility

  • Existing single-pattern env vars (SEMREL_PLUGIN_MINOR_PATTERN etc.) remain supported
  • If both the singular and plural form are set, the plural form takes precedence

Acceptance criteria

  • *_PATTERNS env vars accepted (comma-separated)
  • Any matching pattern triggers the bump
  • Singular *_PATTERN vars still work (backward-compatible)
  • Tests covering multi-pattern AND single-pattern modes
  • README updated with examples showing mixed-style commit matching

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions