Skip to content

Commit

Permalink
fix: signing commit disable for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Dec 8, 2023
1 parent 2d7fe38 commit e421701
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@ echo
commit_regex="^(Merge branch|(feat|fix|chore|refactor|docs|test|style|enhancement):).+"


if git log --show-signature -n 1 | grep -q 'gpg:'; then
if ! echo "$commit_msg" | grep -Ei "$commit_regex" ; then
echo "Aborting commit. Your commit message does not follow the conventional format."
echo "The commit message should begin with one of the following keywords followed by a colon: 'feat', 'fix', 'chore', 'refactor', 'docs', 'test' or 'style'. For example, it should be formatted like this: 'feat: <subject> - <description>'"
exit 1
fi
else
echo "~~~~**** Error: Commit Signature Missing. ****~~~~"
echo "Please make sure to sign your commits. You can sign your commit by using the '-S' option with 'git commit'."
echo "Example: git commit -S -m 'Your commit message'"
echo "Signing commits is crucial for verifying contributions. Consult GitHub's documentation on commit signature verification for guidance: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits"

if ! echo "$commit_msg" | grep -Ei "$commit_regex" ; then
echo "Aborting commit. Your commit message does not follow the conventional format."
echo "The commit message should begin with one of the following keywords followed by a colon: 'feat', 'fix', 'chore', 'refactor', 'docs', 'test' or 'style'. For example, it should be formatted like this: 'feat: <subject> - <description>'"
exit 1
fi

Expand Down

0 comments on commit e421701

Please sign in to comment.