I have a Github repository that we share for our development. To ensure integrity, we decided to sign our commits and tags using GPG.
Now, how can I prevent developers from dragging unsigned commits to our repository on Github, as well as public keys with an open whitelist to allow push commits written with public keys with a green list
I checked a few push hooks, but did not find the method described above, and here it is.
remote="$1"
url="$2"
z40=0000000000000000000000000000000000000000
IFS=' '
while read local_ref local_sha remote_ref remote_sha
do
if [ "$local_sha" = $z40 ]
then
else
if [ "$remote_sha" = $z40 ]
then
range="$local_sha"
else
range="$remote_sha..$local_sha"
fi
commit=`git rev-list -n 1 --grep '^WIP' "$range"`
if [ -n "$commit" ]
then
echo "Found WIP commit in $local_ref, not pushing"
exit 1
fi
fi
done
exit 0
How can i do this? Any concept or examples would be highly appreciated.