-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Git Hooks | ||
|
||
Hooks in this directory check your commit message, and enforce standards. | ||
|
||
To use these hooks in your local workflow, run: | ||
|
||
`git config core.hooksPath .githooks/hooks` | ||
|
||
Read more about [customizing git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# regex to validate in commit msg | ||
commit_regex='(no version bump|patch|minor|major)' | ||
error_msg="Aborting commit. Your commit message is missing versioning instructions. | ||
Please add [no version bump], [patch], [minor], or [major] to your commit message" | ||
|
||
if ! grep -iqE "$commit_regex" "$1"; then | ||
echo "$error_msg" >&2 | ||
exit 1 | ||
fi |
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