Skip to content

Instantly share code, notes, and snippets.

@arnaduga
arnaduga / commit-msg
Last active February 21, 2024 15:06
Setting up a commit message check
#!/bin/bash
cat $1 | grep -w "test\\|refactor\\|feat\\|fix\\|docs\\|breaking-change\\|chore\\|build" > /dev/null
if \[ $? -eq 0 \]; then
echo "✔️ Commit message CHECKED: good."
else
echo "❌ !!WARNING!! Commit message MUST start with test,refactor, fix, feat, docs, breaking-change, chore or build"
echo "❌ COMMIT ABORDED !!!"
exit 1