To enable this check, create a workflow file within the .github/workflows directory
, such as check-commits.yml
.
It will trigger when a pull request is created to main branch and will fail if a commit contains any of the special keywords like:
- WIP - convention for commits that are work in progress
- [skip ci] - skips github workflow.
- Signed-off - git gui offers that option if you're lazy to write your own message.
- Merge something-branch into something - extra commit that happens when you merge changes. Solution is to rebase it.
Check is case insensitive.
I wrote about it in my article https://www.amarjanica.com/git-commits-that-dont-suck-a-beginners-guide#Lazy_Persons_Commit_Linter. I also wrote about some other stuff like git rebasing and clean commits.