neobytes/contrib/verify-commits/pre-push-hook.sh

17 lines
450 B
Bash
Raw Normal View History

#!/bin/bash
2024-02-05 23:00:22 +01:00
if ! [[ "$2" =~ ^(git@)?(www.)?github.com(:|/)neobytes-project/neobytes(.git)?$ ]]; then
exit 0
fi
while read LINE; do
set -- A $LINE
if [ "$4" != "refs/heads/master" ]; then
continue
fi
if ! ./contrib/verify-commits/verify-commits.sh $3 > /dev/null 2>&1; then
echo "ERROR: A commit is not signed, can't push"
./contrib/verify-commits/verify-commits.sh
exit 1
fi
done < /dev/stdin