Think about it with the Tower Support Team.
In my example, I could not capture the argument (i.e. #!/usr/bin/python), changing it to #!/usr/bin/env bash, I was able to get it. Now $1contains an argument.
Full example:
#!/usr/bin/env bash
commit_regex='(gh-\d+|merge)'
error_msg="Aborting commit. Your commit message is missing either a Github Issue ('GH-xxxx') or 'Merge'"
if ! grep -iqE "$commit_regex" "$1"; then
echo "$error_msg" >&2
exit 1
fi
source
share