Skip to content

Add lefthook check for changelog on first commit on branch

David Dieulivol requested to merge ddieulivol-lefthook_check_changelog into main

What does this MR do and why?

Issues a warning in Lefthook if the first commit of the branch doesn't have a Changelog git trailer 🎉

How to set up and validate locally

git checkout ddieulivol-lefthook_check_changelog
git checkout -b my-test-branch
git reset HEAD~1 # Remove the commit from the MR
git add .
git commit -m 'A commit without a changelog'
bundle exec lefthook run pre-push # should fail

git commit --amend

"""
A commit with a changelog

Changelog: added
"""

bundle exec lefthook run pre-push # should succeed

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by David Dieulivol

Merge request reports