Skip to content

ci: support scoped conventional commits in commit-message-check#285

Merged
hardy-dev-infinilabs merged 2 commits intomainfrom
copilot/fix-cookie-session-expiration
Apr 24, 2026
Merged

ci: support scoped conventional commits in commit-message-check#285
hardy-dev-infinilabs merged 2 commits intomainfrom
copilot/fix-cookie-session-expiration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

Summary

The commit-message-check CI workflow was rejecting valid conventional commit messages that include a scope, such as feat(cookie): prevent aggressive session cookie expiration.

Problem

The regex pattern only matched type: description format (e.g., feat: something) but did not support the widely-used scoped format type(scope): description (e.g., feat(cookie): something).

Changes

  • Updated the regex pattern to optionally allow a scope in parentheses after the commit type: type(scope): description
  • Used [^)]+ inside the scope group to reject empty scopes like feat(): message
  • Separated merge/update patterns (which don't use a colon) into their own alternative for clarity
  • Updated the error message to document the optional scope syntax with examples

Validation

Tested the new regex against:

  • feat(cookie): prevent aggressive session cookie expiration
  • feat: add new feature (no scope, still works)
  • fix(auth): resolve login issue
  • merge branch main
  • ✅ All other existing commit types
  • feat(): empty scope (correctly rejected)
  • random commit message (correctly rejected)

Copilot AI requested a review from medcl April 24, 2026 08:59
@medcl medcl marked this pull request as ready for review April 24, 2026 09:08
@hardy-dev-infinilabs hardy-dev-infinilabs merged commit a009983 into main Apr 24, 2026
4 checks passed
@hardy-dev-infinilabs hardy-dev-infinilabs deleted the copilot/fix-cookie-session-expiration branch April 24, 2026 09:17
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.

4 participants