Skip to content

feat: support providing regexps for types #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2025
Merged

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Aug 18, 2025

Similar to #226, this adds support for providing regexs for types which makes it possible to e.g. have Jira keys as a type.

This was about as straightforward as I expected though it turns out the conventional commit header pattern does not allow - characters meaning that also needs to be changed for Jira keys - it would be great if that was handled by the action either by just changing the default pattern entirely or by changing it when a custom type (or maybe even a "probably a regexp" type?) is detected, but either way that's out of scope for this particular change (let me know if you'd be open to it though).

Also something else this would be useful with is the ability to add additional types, rather than having the default list overridden - I'm happy to create a follow up issue and PR if that sounds useful.

Resolves #220

E2E tests:

@G-Rath G-Rath marked this pull request as ready for review August 18, 2025 20:11
Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

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

Perfect PR, thanks a bunch @G-Rath!

@amannn
Copy link
Owner

amannn commented Aug 19, 2025

This was about as straightforward as I expected though it turns out the conventional commit header pattern does not allow - characters meaning that also needs to be changed for Jira keys - it would be great if that was handled by the action either by just changing the default pattern entirely or by changing it when a custom type (or maybe even a "probably a regexp" type?) is detected, but either way that's out of scope for this particular change (let me know if you'd be open to it though).

The primary use case for this action is to match PR titles against the Conventional Commits spec. I think I'd prefer to stick to their defaults to avoid surprises.

Also something else this would be useful with is the ability to add additional types, rather than having the default list overridden - I'm happy to create a follow up issue and PR if that sounds useful.

I think API-wise this might be a bit tough to get in. We already have a config option to use entirely different types, so this would likely mean another config option, which can essentially be used for the same thing. Sorry, I think also here I'd prefer to keep the action a bit more minimalistic!

Sorry for pushing back a bit here, I hope this makes sense!

@amannn amannn merged commit a30288b into amannn:main Aug 19, 2025
42 checks passed
Copy link

🎉 This PR is included in version 6.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

Use regex when comparing header types
2 participants