Skip to content

Instantly share code, notes, and snippets.

@ab9-er
Forked from jirkapenzes/commit-msg
Created December 3, 2015 14:17
Show Gist options
  • Save ab9-er/d802b1798b6174abfb84 to your computer and use it in GitHub Desktop.
Save ab9-er/d802b1798b6174abfb84 to your computer and use it in GitHub Desktop.
Script to check Jira issue number in commit message
#!/bin/sh
#
# The hook check if commit message include jira ticket number.
# Example:
# Message: Refactoring (WEBAPI-100)
#
# Script location: .git/hooks/commit-msg
#
test "" != "$(grep '\(WEBAPI-[0-9]\+\)' "$1")" || {
echo >&2 "ERROR: Commit message is missing Jira issue number."
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment