I have the following bash script.
The problem I try to solve is really easy. When a commit in Git no starts with gh-1234 ... it should fail.
What is wrong with this bash script?
commit_regex='(gh-[0-9]+|merge)'
error_msg="Aborting commit. Your commit message is missing either a Github Issue ('gh-1111') or 'Merge'."
if ! grep -q "$commit_regex" <<< "$1"; then
echo "$error_msg" >&2
exit 1
fi
grep -E?