GsActions / commit-message-checker

GitHub Action that checks commit messages of pushes and pull request against a regex pattern
MIT License
99 stars 56 forks source link

Add an option to invert the check (fail if RegExp succeeds) #92

Open happycollision opened 1 year ago

happycollision commented 1 year ago

Code of Conduct

Is there an existing issue for this?

Are you willing to sponsor your idea?

Is your feature request related to a problem? Please describe

I am trying to fail if a commit message starts with fixup or squash. I am also trying to fail if a message contains [no-merge]. It is far easier to check for the existence of these things than confirm the negative.

Describe the solution you'd like

A new flag: failOnMatch. It defaults to false (current behavior). Setting to true will fail if the pattern matches on a commit.

Describe alternatives you've considered

RegExp negative lookahead. Ugh. Not easy to understand for the next person to look at the code. (AKA me, in five minutes.)

Additional context

No response

happycollision commented 1 year ago

I’ll take a crack at this tonight if I have some spare time. If I didn’t, then someone else should feel free to grab this if it is a desired feature.