Skip to content

Instantly share code, notes, and snippets.

@danielkaczmarczyk
Last active October 20, 2017 15:46
Show Gist options
  • Save danielkaczmarczyk/93f837cd55227a1981e3e50df998900e to your computer and use it in GitHub Desktop.
Save danielkaczmarczyk/93f837cd55227a1981e3e50df998900e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
commit_regex='(ED\-\d+)|(QUICKFIX)\s.+'
error_msg="Aborting commit. Your commit message must start with a ED-<JIRA ticket number> prefix, or with the word QUICKFIX. Regex: (ED\-\d+)|(QUICKFIX)\s.+ "
if ! grep -iqE "$commit_regex" "$1"; then
echo "$error_msg" >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment