Skip to content

fix(commits): accept ! breaking-change marker in subject#32

Merged
apermo merged 2 commits into
mainfrom
fix/conventional-commits-breaking-marker
May 1, 2026
Merged

fix(commits): accept ! breaking-change marker in subject#32
apermo merged 2 commits into
mainfrom
fix/conventional-commits-breaking-marker

Conversation

@apermo
Copy link
Copy Markdown
Owner

@apermo apermo commented May 1, 2026

Summary

  • Extend the regex in reusable-conventional-commits.yml to allow an optional ! between the type/scope and the colon, so spec-compliant breaking-change subjects like feat(api)!: drop x pass validation.
  • CHANGELOG entry under ## [0.6.1].

Why

Conventional Commits 1.0 defines two equivalent ways to mark a breaking change:

  1. A ! after the type/scope, before the colon — e.g. feat(stale)!: drop legacy inputs
  2. A BREAKING CHANGE: footer in the body

The validator regex only accepted the footer form. The 0.6.0 release commit (feat(stale)!: per-type timeouts for issues and PRs) was rejected by CI, forcing a rewrite of the subject to drop the ! and rely solely on the body footer. Both forms are spec-valid; the validator should accept either.

Change

-^(${ALLOWED_TYPES})(\(.+\))?: .{1,}$
+^(${ALLOWED_TYPES})(\(.+\))?!?: .{1,}$

The !? is zero-or-one literal !, composing correctly with the optional scope group.

Test plan

Smoke-tested locally — all four spec-valid forms pass, and previously-rejected non-conventional input still rejects:

Subject Expected Result
feat: foo pass pass
feat!: foo pass pass
feat(api): foo pass pass
feat(api)!: foo pass pass
feat(api): (empty subject) reject reject
random text reject reject
  • actionlint clean
  • Local regex smoke test (above)
  • CI on this PR validates the commit fix(commits): accept ! breaking-change marker in subject (which itself does not use !, so this PR can land cleanly under the old regex)

Compatibility

Pure loosening — every previously-accepted subject is still accepted. No caller changes required.

Conventional Commits 1.0 defines ! after the type/scope as
equivalent to a BREAKING CHANGE footer. The validator regex
only accepted the footer form, rejecting spec-valid subjects
like feat(api)!: drop x. Add an optional !? before the colon.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the commit message validation logic to align with the Conventional Commits 1.0 specification. By allowing the '!' character before the colon in commit subjects, the validator now correctly handles breaking changes as defined by the spec, preventing valid commits from being rejected by CI.

Highlights

  • Regex Update: Updated the validation regex in reusable-conventional-commits.yml to support the optional '!' breaking-change marker in commit subjects.
  • Changelog: Added a new entry for version 0.6.1 documenting the fix for breaking-change marker support.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/reusable-conventional-commits.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


A bang in the subject line found, / Where breaking changes now abound. / The regex was tight, / But now it is right, / And spec-compliant commits are unbound.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CHANGELOG.md to document a fix for the reusable-conventional-commits.yml workflow, allowing the ! breaking-change marker in commit subjects. The reviewer noted that the actual code changes to the workflow file are missing from the PR and suggested a wording improvement in the changelog to accurately reflect the project's release history.

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the reusable Conventional Commits validator to accept the spec-compliant ! breaking-change marker in the commit subject (e.g. feat(api)!: …), and records the fix in the changelog.

Changes:

  • Loosen the commit-subject validation regex to allow an optional ! before the colon.
  • Add a 0.6.1 changelog entry documenting the validator fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
CHANGELOG.md Adds a 0.6.1 entry describing acceptance of ! in Conventional Commit subjects.
.github/workflows/reusable-conventional-commits.yml Updates the grep -P regex to allow ! after type/scope, before :.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The 0.6.0 release commit had to be rewritten to drop the !
marker to pass CI under the old regex. Say "intended" rather
than "used" so the entry matches the actual git history.
@apermo apermo merged commit 0426b2c into main May 1, 2026
3 checks passed
@apermo apermo deleted the fix/conventional-commits-breaking-marker branch May 1, 2026 07:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Released as v0.6.1

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.

2 participants