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

[FEATURE] Skip merge commits in pull requests #79

Open GriceTurrble opened 2 years ago

GriceTurrble commented 2 years ago

Merge commits can be identified by having two parent commits, so we add to the GraphQL query selecting PR commits to also return parents.totalCount. This shows any standard commit having 1 parent, and merge commits having 2.

We can then .filter() out those instances before mapping commit messages.

Should fix #75


Note that TypeScript/JavaScript are not my strong suit. I would appreciate assistance in adding tests and perhaps bringing the same check to the push event.

gilbertsoft commented 1 year ago

Thanks for your PR @GriceTurrble . In the meantime I've extended the tests and also added the feature to the push event.

simoneversienti commented 3 months ago

Skipping merge commits is an interesting and useful feature. is this PR still valid?