Created
February 24, 2021 06:14
-
-
Save imnnquy/b8aa854ff0cfca16c9a0346714a4d0d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
path="$1" | |
message=$(cat "$path") | |
echo "$message" | |
# shellcheck disable=SC2039 | |
if ! [[ $message =~ ^US([0-9]{5})(\s*)* ]]; then | |
printf '\n\e[1;31mERROR: Your commit message must contain User Story ID\e[0m\n\n' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment