Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PASS1-125: Add Git commit-msg hook to check for Linear ID #24

Merged
merged 2 commits into from
Jul 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

TEAM_PREFIX='PASS1'
commit_regex="^($TEAM_PREFIX-[0-9]+:\ )"

if ! `grep -iqE "$commit_regex" "$1"`; then
echo "=========================================================================================" >&2
echo "Aborting commit. Your commit message must start with a Linear issue ID, colon then space." >&2
echo "Example: '$TEAM_PREFIX-123: ' (To commit anyway, use the --no-verify option)" >&2
echo "=========================================================================================" >&2
exit 1
fi