I’m using self-managed my gitlab is in version 12.6.3 (13cad23a0e4)
I am building a hook that checks the commit email. The email must be the same as the logged in user, it works like this:
while read oldrev newrev refname
do
ce=$(git show -s --format='format:%ce' $newrev)
if [[ "$ce" != "${GL_USERNAME}@domaind.com" ]] ; then
echo "GL-HOOK-ERR: Erro!"
echo "GL-HOOK-ERR: Email Author: $ce"
echo "GL-HOOK-ERR: E-mail user: ${GL_USERNAME}@domaind.com"
exit 1
fi
done
This is working, but I am encountering a problem when I create a new branch through gitlab, always creating the new branch with the root user. How do I get gitlab to create the branch with the logged in user?