Skip to content

Commit

Permalink
misc: add script to check commit signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamez committed Feb 26, 2025
1 parent b9bf8f6 commit eb56c5b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .lefthook/pre-push/check_signatures.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Get the name of the current branch
current_branch=$(git rev-parse --abbrev-ref HEAD)

# Check if non-pushed commits are signed
if git log origin/"$current_branch"..HEAD --pretty=format:'%G?' | grep -qv "G"; then
echo "Error: One or more non-pushed commits are not signed."
exit 1
else
echo "All non-pushed commits are properly signed."
exit 0
fi

0 comments on commit eb56c5b

Please sign in to comment.