Skip to content

Instantly share code, notes, and snippets.

@syzer
Created June 13, 2022 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syzer/491dc16e79e56c5e6358a8c52f5fcd6b to your computer and use it in GitHub Desktop.
Save syzer/491dc16e79e56c5e6358a8c52f5fcd6b to your computer and use it in GitHub Desktop.
Precommit hook to skip committing when CHANGELOG not updated
#!/bin/bash
#in .git/pre-commit
lint-staged
# CHANGELOG
if git status -s | grep -q "M CHANGELOG.md"; then
echo "# CHANGELOG Not updated."
exit 1
else
echo "# CHANGELOG updated."
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment