-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix git pre-commit action failure (#62)
* test just commit message * accurate name * surround with `"` * fix mistake * attempt email from core * attempt with small brackets * attempt with `--` * remove nums * attempt with husky updates * update to lockfile * new attempt * try with else block * add shebang * test with grep pattern matching * dummy git adds * update dummy add * revert changes to yaml --------- Co-authored-by: Anmol Shrestha <[email protected]> Co-authored-by: Anmol Shrestha <[email protected]>
- Loading branch information
1 parent
ceff52e
commit cbac2a0
Showing
4 changed files
with
8 additions
and
12 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
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
# validate email | ||
emailPattern="[^@]+@users\\.noreply\\.github\\.com" | ||
email=$(git config user.email) | ||
|
||
if ! [[ $email =~ $emailPattern ]]; then | ||
if echo "$email" | grep -qvE "$emailPattern"; then | ||
echo "Git commits should be using an e-mail like this pattern: \"$emailPattern\"" | ||
echo "But yours is configured like this: $email" | ||
echo "To fix it, you can use command like this:" | ||
echo "git config --local user.email \"[email protected]\"" | ||
exit 1; | ||
fi | ||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.